mirror of
https://github.com/msgpack/msgpack-python.git
synced 2025-11-09 05:51:02 +00:00
Add NULL check.
This commit is contained in:
parent
0fa8c102d7
commit
79e44f86c9
1 changed files with 3 additions and 0 deletions
|
|
@ -206,6 +206,9 @@ static inline int template_callback_map_end(unpack_user* u, msgpack_unpack_objec
|
||||||
{
|
{
|
||||||
if (u->object_hook) {
|
if (u->object_hook) {
|
||||||
PyObject *new_c = PyEval_CallFunction(u->object_hook, "(O)", *c);
|
PyObject *new_c = PyEval_CallFunction(u->object_hook, "(O)", *c);
|
||||||
|
if (new_c == NULL) {
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
Py_DECREF(*c);
|
Py_DECREF(*c);
|
||||||
*c = new_c;
|
*c = new_c;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue