Python rpm.te Key() refcount fix (rhbz#182063) from JBJ.
authorPanu Matilainen <pmatilai@redhat.com>
Tue, 5 Jun 2007 12:18:49 +0000 (15:18 +0300)
committerPanu Matilainen <pmatilai@redhat.com>
Tue, 5 Jun 2007 12:18:49 +0000 (15:18 +0300)
python/rpmte-py.c

index 4f40bbd..58df539 100644 (file)
@@ -221,10 +221,9 @@ rpmte_Key(rpmteObject * s)
 
     /* XXX how to insure this is a PyObject??? */
     Key = (PyObject *) rpmteKey(s->te);
-    if (Key == NULL) {
-       Py_INCREF(Py_None);
-       return Py_None;
-    }
+    if (Key == NULL)
+      Key = Py_None;
+       Py_INCREF(Key);
     return Key;
 }