* python/py-cmd.c (gdbpy_string_to_argv): Decrement reference
authorPaul Koning <pkoning@equallogic.com>
Thu, 15 Sep 2011 18:33:15 +0000 (18:33 +0000)
committerPaul Koning <pkoning@equallogic.com>
Thu, 15 Sep 2011 18:33:15 +0000 (18:33 +0000)
count of item appended to list.
* python/py-type.c (typy_fields): Likewise.

gdb/ChangeLog
gdb/python/py-cmd.c
gdb/python/py-type.c

index fb9b6f176855adb72973024ed9dce4fe9d7b53c2..19d3709580a2c832b13d33badb65d79915e33a94 100644 (file)
@@ -1,3 +1,9 @@
+2011-09-15  Paul Koning  <paul_koning@dell.com>
+
+       * 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  <paul_koning@dell.com>
 
        * MAINTAINERS (Write After Approval): Add myself to the list.
index 677c1e416e09dfc570f73f10dd96fb6a3d59e465..cfddff8d6006a24aa7a3f3bcf29bb74236d00f46 100644 (file)
@@ -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);
index 335342e4871bd3946128060f71c54ebb063bde10..29b2629c274fb18615bc5459bfe179539e467e80 100644 (file)
@@ -246,6 +246,7 @@ typy_fields (PyObject *self, PyObject *args)
          Py_DECREF (result);
          return NULL;
        }
+      Py_DECREF (dict);
     }
 
   return result;