* py-evtregistry.c (create_event_object): Decref

eventregistry_object if PyList_New fails.
This commit is contained in:
Tom Tromey 2013-05-20 20:16:24 +00:00
parent 3919fd966c
commit f04010ffab
2 changed files with 9 additions and 1 deletions

View File

@ -1,3 +1,8 @@
2013-05-20 Tom Tromey <tromey@redhat.com>
* py-evtregistry.c (create_event_object): Decref
eventregistry_object if PyList_New fails.
2013-05-20 Tom Tromey <tromey@redhat.com>
* py-cmd.c (gdbpy_string_to_argv): Check result of

View File

@ -89,7 +89,10 @@ create_eventregistry_object (void)
eventregistry_obj->callbacks = PyList_New (0);
if (!eventregistry_obj->callbacks)
return NULL;
{
Py_DECREF (eventregistry_obj);
return NULL;
}
return eventregistry_obj;
}