fixed
authormsw <devnull@localhost>
Thu, 24 Aug 2000 06:16:44 +0000 (06:16 +0000)
committermsw <devnull@localhost>
Thu, 24 Aug 2000 06:16:44 +0000 (06:16 +0000)
CVS patchset: 4115
CVS date: 2000/08/24 06:16:44

python/rpmmodule.c

index 2fb9185..97bc896 100644 (file)
@@ -1836,15 +1836,18 @@ static PyObject * checkSig (PyObject * self, PyObject * args) {
 
 static PyObject * getTsHeader (PyObject * self, PyObject * args) {
     hdrObject * h;
-
-    h = (hdrObject *) PyObject_NEW(PyObject, &hdrType);
-    h->h = transactionSetHeader;
-    h->sigs = NULL;
-    h->fileList = h->linkList = h->md5list = NULL;
-    h->uids = h->gids = h->mtimes = h->fileSizes = NULL;
-    h->modes = h->rdevs = NULL;
     
-    return h;
+    if (transactionSetHeader) {
+       h = (hdrObject *) PyObject_NEW(PyObject, &hdrType);
+       h->h = headerLink(transactionSetHeader);
+       h->sigs = NULL;
+       h->fileList = h->linkList = h->md5list = NULL;
+       h->uids = h->gids = h->mtimes = h->fileSizes = NULL;
+       h->modes = h->rdevs = NULL;
+       return h;
+    }
+    Py_INCREF(Py_None);
+    return (hdrObject *) Py_None;
 }
 
 /* disable