17 int rpmfdFromPyObject(PyObject *obj, rpmfdObject **fdop)
18 {
19 rpmfdObject *fdo = NULL;
20
21 if (rpmfdObject_Check(obj)) {
22 Py_INCREF(obj);
taking False path
23 fdo = (rpmfdObject *) obj;
24 } else {
25 fdo = (rpmfdObject *) PyObject_CallFunctionObjArgs((PyObject *)&rpmfd_Type,
26 obj, NULL);
when PyObject_CallFunctionObjArgs() succeeds
27 }
28 if (fdo == NULL) return 0;
29
taking False path
30 if (Ferror(fdo->fd)) {
31 Py_DECREF(fdo);
when taking True path
32 PyErr_SetString(PyExc_IOError, Fstrerror(fdo->fd));
when taking False path
calling tp_dealloc on new ref from call to PyObject_CallFunctionObjArgs allocated at rpmfd-py.c:26
33 return 0;
reading from deallocated memory at rpmfd-py.c:33: memory deallocated at rpmfd-py.c:32
34 }
35 *fdop = fdo;
36 return 1;
37 }
38