summaryrefslogtreecommitdiff
path: root/msgpack/unpack.h
diff options
context:
space:
mode:
authorAlexei Romanoff <drednout.by@gmail.com>2012-10-12 12:32:32 +0300
committerAlexei Romanoff <drednout.by@gmail.com>2012-10-12 12:32:32 +0300
commit89ce16df39f67ac77785a63b4111c353f0a606a3 (patch)
treef2ff5b1aa68b74821118770f024650558dcd2796 /msgpack/unpack.h
parentd5f99959cc2ec393c13fc9e44714351272bac7fc (diff)
downloadmsgpack-python-89ce16df39f67ac77785a63b4111c353f0a606a3.tar.gz
A segfault fixed in the issue https://github.com/msgpack/msgpack-python/issues/28
Diffstat (limited to 'msgpack/unpack.h')
-rw-r--r--msgpack/unpack.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/msgpack/unpack.h b/msgpack/unpack.h
index 5ec7dbc..61e5d91 100644
--- a/msgpack/unpack.h
+++ b/msgpack/unpack.h
@@ -207,6 +207,9 @@ static inline int template_callback_map_end(unpack_user* u, msgpack_unpack_objec
{
if (u->object_hook) {
PyObject *new_c = PyEval_CallFunction(u->object_hook, "(O)", *c);
+ if (!new_c)
+ return -1;
+
Py_DECREF(*c);
*c = new_c;
}