From: Paul Koning Date: Thu, 15 Sep 2011 18:33:15 +0000 (+0000) Subject: * python/py-cmd.c (gdbpy_string_to_argv): Decrement reference X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=5af65ec072edf782b67169fd3ea1b91b8255d30f;p=binutils-gdb.git * python/py-cmd.c (gdbpy_string_to_argv): Decrement reference count of item appended to list. * python/py-type.c (typy_fields): Likewise. --- diff --git a/gdb/ChangeLog b/gdb/ChangeLog index fb9b6f17685..19d3709580a 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,9 @@ +2011-09-15 Paul Koning + + * python/py-cmd.c (gdbpy_string_to_argv): Decrement reference + count of item appended to list. + * python/py-type.c (typy_fields): Likewise. + 2011-09-15 Paul Koning * MAINTAINERS (Write After Approval): Add myself to the list. diff --git a/gdb/python/py-cmd.c b/gdb/python/py-cmd.c index 677c1e416e0..cfddff8d600 100644 --- a/gdb/python/py-cmd.c +++ b/gdb/python/py-cmd.c @@ -683,14 +683,12 @@ gdbpy_string_to_argv (PyObject *self, PyObject *args) if (argp == NULL || PyList_Append (py_argv, argp) < 0) { - if (argp != NULL) - { - Py_DECREF (argp); - } + Py_XDECREF (argp); Py_DECREF (py_argv); freeargv (c_argv); return NULL; } + Py_DECREF (argp); } freeargv (c_argv); diff --git a/gdb/python/py-type.c b/gdb/python/py-type.c index 335342e4871..29b2629c274 100644 --- a/gdb/python/py-type.c +++ b/gdb/python/py-type.c @@ -246,6 +246,7 @@ typy_fields (PyObject *self, PyObject *args) Py_DECREF (result); return NULL; } + Py_DECREF (dict); } return result;