File: rpmfd-py.c
Function: rpmfdFromPyObject
Error: ob_refcnt of new ref from call to Py_BuildValue is 1 too high
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_Call((PyObject *)&rpmfd_Type,
26 			    		    Py_BuildValue("(O)", obj), NULL);
when Py_BuildValue() succeeds
when PyObject_Call() succeeds
new ref from call to Py_BuildValue allocated at: 	fdo = (rpmfdObject *) PyObject_Call((PyObject *)&rpmfd_Type,
ob_refcnt is now refs: 1 + N where N >= 0
27     }
28     if (fdo == NULL) return 0;
29 
taking False path
30     if (Ferror(fdo->fd)) {
31 	Py_DECREF(fdo);
when considering range: -0x80000000 <= value <= -1
taking True path
32 	PyErr_SetString(PyExc_IOError, Fstrerror(fdo->fd));
when taking True path
33 	return 0;
calling PyErr_SetString()
34     }
35     *fdop = fdo;
36     return 1;
37 }
38 
ob_refcnt of new ref from call to Py_BuildValue is 1 too high was expecting final ob_refcnt to be N + 0 (for some unknown N) but final ob_refcnt is N + 1 found 3 similar trace(s) to this

File: rpmfd-py.c
Function: rpmfdFromPyObject
Error: reading from deallocated memory at rpmfd-py.c:33: memory deallocated at rpmfd-py.c:32
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_Call((PyObject *)&rpmfd_Type,
26 			    		    Py_BuildValue("(O)", obj), NULL);
when Py_BuildValue() succeeds
when PyObject_Call() succeeds
27     }
28     if (fdo == NULL) return 0;
29 
taking False path
30     if (Ferror(fdo->fd)) {
31 	Py_DECREF(fdo);
when considering range: -0x80000000 <= value <= -1
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_Call 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
found 1 similar trace(s) to this
34     }
35     *fdop = fdo;
36     return 1;
37 }
38 

File: rpmfd-py.c
Function: rpmfdFromPyObject
Error: calling PyObject_Call with NULL as argument 2 (D.15789) at rpmfd-py.c:26
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_Call((PyObject *)&rpmfd_Type,
26 			    		    Py_BuildValue("(O)", obj), NULL);
when Py_BuildValue() fails
calling PyObject_Call with NULL as argument 2 (D.15789) at rpmfd-py.c:26
27     }
28     if (fdo == NULL) return 0;
29 
30     if (Ferror(fdo->fd)) {
31 	Py_DECREF(fdo);
32 	PyErr_SetString(PyExc_IOError, Fstrerror(fdo->fd));
33 	return 0;
34     }
35     *fdop = fdo;
36     return 1;
37 }
38