From f04010ffab35dc11d5b072f2f6bc5ba6022c3c2d Mon Sep 17 00:00:00 2001 From: Tom Tromey Date: Mon, 20 May 2013 20:16:24 +0000 Subject: [PATCH] * py-evtregistry.c (create_event_object): Decref eventregistry_object if PyList_New fails. --- gdb/ChangeLog | 5 +++++ gdb/python/py-evtregistry.c | 5 ++++- 2 files changed, 9 insertions(+), 1 deletion(-) 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; } -- 2.30.2