From: Tom Tromey Date: Mon, 20 May 2013 20:16:24 +0000 (+0000) Subject: * py-evtregistry.c (create_event_object): Decref X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=f04010ffab35dc11d5b072f2f6bc5ba6022c3c2d;p=binutils-gdb.git * py-evtregistry.c (create_event_object): Decref eventregistry_object if PyList_New fails. --- diff --git a/gdb/ChangeLog b/gdb/ChangeLog index a9f4354e033..8b417da7032 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,8 @@ +2013-05-20 Tom Tromey + + * py-evtregistry.c (create_event_object): Decref + eventregistry_object if PyList_New fails. + 2013-05-20 Tom Tromey * py-cmd.c (gdbpy_string_to_argv): Check result of diff --git a/gdb/python/py-evtregistry.c b/gdb/python/py-evtregistry.c index c8003af9af7..05c85864e71 100644 --- a/gdb/python/py-evtregistry.c +++ b/gdb/python/py-evtregistry.c @@ -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; }