Skip to content

Commit 79e44f8

Browse files
committed
Add NULL check.
1 parent 0fa8c10 commit 79e44f8

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

msgpack/unpack.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -206,6 +206,9 @@ static inline int template_callback_map_end(unpack_user* u, msgpack_unpack_objec
206206
{
207207
if (u->object_hook) {
208208
PyObject *new_c = PyEval_CallFunction(u->object_hook, "(O)", *c);
209+
if (new_c == NULL) {
210+
return -1;
211+
}
209212
Py_DECREF(*c);
210213
*c = new_c;
211214
}

0 commit comments

Comments
 (0)