projects
/
services
/
createrepo_c.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
85ad85c
)
Python: xml_parser: Fix error when newpkgcb returns None.
author
Tomas Mlcoch
<tmlcoch@redhat.com>
Mon, 10 Jun 2013 12:01:24 +0000
(14:01 +0200)
committer
Tomas Mlcoch
<tmlcoch@redhat.com>
Mon, 10 Jun 2013 12:01:24 +0000
(14:01 +0200)
src/python/xml_parser-py.c
patch
|
blob
|
history
diff --git
a/src/python/xml_parser-py.c
b/src/python/xml_parser-py.c
index
63fe514
..
faeafdd
100644
(file)
--- a/
src/python/xml_parser-py.c
+++ b/
src/python/xml_parser-py.c
@@
-70,8
+70,14
@@
c_newpkgcb(cr_Package **pkg,
return CR_CB_RET_ERR;
}
- *pkg = Package_FromPyObject(result);
- data->py_pkg = result; // Store reference to current package
+ if (result == Py_None) {
+ *pkg = NULL;
+ data->py_pkg = NULL;
+ Py_DECREF(result);
+ } else {
+ *pkg = Package_FromPyObject(result);
+ data->py_pkg = result; // Store reference to current package
+ }
return CR_CB_RET_OK;
}