* python/python.c (finish_python_initialization): Decref
authorTom Tromey <tromey@redhat.com>
Tue, 18 Jun 2013 18:42:09 +0000 (18:42 +0000)
committerTom Tromey <tromey@redhat.com>
Tue, 18 Jun 2013 18:42:09 +0000 (18:42 +0000)
'pythondir' on failure path as well.

gdb/ChangeLog
gdb/python/python.c

index 16fc3515442682fcd77b1cb5b0cbf98a55f60161..c162970f3c3034db110fa5d7ae6d405c7a0af6a8 100644 (file)
@@ -1,3 +1,8 @@
+2013-06-18  Tom Tromey  <tromey@redhat.com>
+
+       * python/python.c (finish_python_initialization): Decref
+       'pythondir' on failure path as well.
+
 2013-06-18  Tom Tromey  <tromey@redhat.com>
 
        PR symtab/15391:
index c94198e2985f8e4c1b378714ea1ff24d187780aa..00092c739da7ada431ff7e3f280e327e00ff5f45 100644 (file)
@@ -1771,10 +1771,9 @@ finish_python_initialization (void)
        goto fail;
 
       err = PyList_Insert (sys_path, 0, pythondir);
+      Py_DECREF (pythondir);
       if (err)
        goto fail;
-
-      Py_DECREF (pythondir);
     }
   else
     goto fail;