From 35a69ac9c2fbf6b68b970352791f6d98fbd74963 Mon Sep 17 00:00:00 2001 From: INADA Naoki Date: Sun, 8 Nov 2015 12:38:38 +0900 Subject: Decrease refcnt when error happend while unpacking Fixes #152 --- msgpack/unpack_template.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'msgpack/unpack_template.h') diff --git a/msgpack/unpack_template.h b/msgpack/unpack_template.h index 5b389b8..6b83d3e 100644 --- a/msgpack/unpack_template.h +++ b/msgpack/unpack_template.h @@ -70,6 +70,10 @@ static inline PyObject* unpack_data(unpack_context* ctx) return (ctx)->stack[0].obj; } +static inline PyObject* unpack_clear(unpack_context *ctx) +{ + Py_CLEAR(ctx->stack[0].obj); +} template static inline int unpack_execute(unpack_context* ctx, const char* data, Py_ssize_t len, Py_ssize_t* off) -- cgit v1.2.1