aboutsummaryrefslogtreecommitdiff
path: root/gdb
diff options
context:
space:
mode:
authorTom Tromey <tromey@redhat.com>2013-05-20 20:32:56 +0000
committerTom Tromey <tromey@redhat.com>2013-05-20 20:32:56 +0000
commit02146ba51f96bbda66cef7da9cc6efa863a50328 (patch)
tree98e7547a48e90f34f2554da8fa83a0bcd28420ac /gdb
parent33ee792fe5d3d9622fde9a027e10f157cbad75c0 (diff)
downloadgdb-02146ba51f96bbda66cef7da9cc6efa863a50328.zip
gdb-02146ba51f96bbda66cef7da9cc6efa863a50328.tar.gz
gdb-02146ba51f96bbda66cef7da9cc6efa863a50328.tar.bz2
* python/python.c (gdbpy_run_events): Decref the result
of PyObject_CallObject.
Diffstat (limited to 'gdb')
-rw-r--r--gdb/ChangeLog5
-rw-r--r--gdb/python/python.c6
2 files changed, 10 insertions, 1 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index db245ea..4dea044 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,5 +1,10 @@
2013-05-20 Tom Tromey <tromey@redhat.com>
+ * python/python.c (gdbpy_run_events): Decref the result
+ of PyObject_CallObject.
+
+2013-05-20 Tom Tromey <tromey@redhat.com>
+
* python/py-symtab.c (set_sal): Use
CPYCHECKER_NEGATIVE_RESULT_SETS_EXCEPTION. Return -1 on error.
(symtab_and_line_to_sal_object): Update.
diff --git a/gdb/python/python.c b/gdb/python/python.c
index e8a70da..605efc0 100644
--- a/gdb/python/python.c
+++ b/gdb/python/python.c
@@ -819,6 +819,8 @@ gdbpy_run_events (struct serial *scb, void *context)
while (gdbpy_event_list)
{
+ PyObject *call_result;
+
/* Dispatching the event might push a new element onto the event
loop, so we update here "atomically enough". */
struct gdbpy_event *item = gdbpy_event_list;
@@ -827,9 +829,11 @@ gdbpy_run_events (struct serial *scb, void *context)
gdbpy_event_list_end = &gdbpy_event_list;
/* Ignore errors. */
- if (PyObject_CallObject (item->event, NULL) == NULL)
+ call_result = PyObject_CallObject (item->event, NULL);
+ if (call_result == NULL)
PyErr_Clear ();
+ Py_XDECREF (call_result);
Py_DECREF (item->event);
xfree (item);
}