aboutsummaryrefslogtreecommitdiff
path: root/gdb/python
diff options
context:
space:
mode:
authorTom Tromey <tromey@redhat.com>2013-05-20 20:16:24 +0000
committerTom Tromey <tromey@redhat.com>2013-05-20 20:16:24 +0000
commitf04010ffab35dc11d5b072f2f6bc5ba6022c3c2d (patch)
tree48aebc9065d6f2328d02b6b4f7f692535308b26a /gdb/python
parent3919fd966cd15e6ef79aa58e3e75ef12d764999f (diff)
downloadgdb-f04010ffab35dc11d5b072f2f6bc5ba6022c3c2d.zip
gdb-f04010ffab35dc11d5b072f2f6bc5ba6022c3c2d.tar.gz
gdb-f04010ffab35dc11d5b072f2f6bc5ba6022c3c2d.tar.bz2
* py-evtregistry.c (create_event_object): Decref
eventregistry_object if PyList_New fails.
Diffstat (limited to 'gdb/python')
-rw-r--r--gdb/python/py-evtregistry.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/gdb/python/py-evtregistry.c b/gdb/python/py-evtregistry.c
index c8003af..05c8586 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;
}