From db6573d6646f950b5a758fd68d180de8ae1e8981 Mon Sep 17 00:00:00 2001 From: Tom Tromey Date: Wed, 15 Aug 2012 14:22:02 +0000 Subject: PR python/14387: * python/py-bpevent.c (create_breakpoint_event_object): Update comment. * python/py-event.c (evpy_add_attribute): Update comment. * python/py-exitedevent.c (create_exited_event_object): Fix reference counting and error handling. * python/py-newobjfileevent.c (create_new_objfile_event_object): Fix reference counting. * python/py-signalevent.c (create_signal_event_object): Fix reference counting and error handling. * python/py-stopevent.c (emit_stop_event): Fix reference counting. * python/py-threadevent.c (get_event_thread): Return a borrowed reference. * python/py-type.c (convert_field): Fix reference counting. --- gdb/python/py-newobjfileevent.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'gdb/python/py-newobjfileevent.c') diff --git a/gdb/python/py-newobjfileevent.c b/gdb/python/py-newobjfileevent.c index d014be6..3059ae4 100644 --- a/gdb/python/py-newobjfileevent.c +++ b/gdb/python/py-newobjfileevent.c @@ -25,7 +25,7 @@ static PyObject * create_new_objfile_event_object (struct objfile *objfile) { PyObject *objfile_event; - PyObject *py_objfile; + PyObject *py_objfile = NULL; objfile_event = create_event_object (&new_objfile_event_object_type); if (!objfile_event) @@ -36,10 +36,12 @@ create_new_objfile_event_object (struct objfile *objfile) "new_objfile", py_objfile) < 0) goto fail; + Py_DECREF (py_objfile); return objfile_event; fail: + Py_XDECREF (py_objfile); Py_XDECREF (objfile_event); return NULL; } -- cgit v1.1