Fix hdrContains() return value on error
authorPanu Matilainen <pmatilai@redhat.com>
Mon, 23 Nov 2009 14:45:09 +0000 (16:45 +0200)
committerPanu Matilainen <pmatilai@redhat.com>
Mon, 23 Nov 2009 14:45:09 +0000 (16:45 +0200)
python/header-py.c

index 57eb74b..9203156 100644 (file)
@@ -247,7 +247,7 @@ static PyObject *hdrIsSource(hdrObject *s)
 static int hdrContains(hdrObject *s, PyObject *pytag)
 {
     rpmTag tag;
-    if (!tagNumFromPyObject(pytag, &tag)) return NULL;
+    if (!tagNumFromPyObject(pytag, &tag)) return -1;
 
     return headerIsEntry(s->h, tag);
 }