static PyObject * |
_mysql_escape_dict( |
PyObject *self, |
PyObject *args) |
{ |
PyObject *o=NULL, *d=NULL, *r=NULL, *item, *quoted, *pkey; |
Py_ssize_t ppos = 0; |
if (!PyArg_ParseTuple(args, "O!O:escape_dict", &PyDict_Type, &o, &d)) |
goto error; |
if (!PyMapping_Check(d)) { |
PyErr_SetString(PyExc_TypeError, |
"argument 2 must be a mapping"); |
return NULL; |
} |
if (!(r = PyDict_New())) goto error; |
while (PyDict_Next(o, &ppos, &pkey, &item)) { |
quoted = _escape_item(item, d); |
if (!quoted) goto error; |
if (PyDict_SetItem(r, pkey, quoted)==-1) goto error; |
Py_DECREF(quoted); |
} |
return r; |
error: |
Py_XDECREF(r); |
return NULL; |
} |
was expecting final owned ob_refcnt of '*quoted' to be 0 since nothing references it but final ob_refcnt is refs: 1 owned
found 7 similar trace(s) to this
when PyArg_ParseTuple() succeeds
taking False path
when considering range: -0x80000000 <= value <= -1
taking False path
when PyDict_New() succeeds
taking False path
when considering range: -0x80000000 <= value <= -1
taking True path
when _escape_item() succeeds
'*quoted' was allocated at: quoted = _escape_item(item, d);
taking False path
when treating unknown struct PyObject * * from _mysql.c:1276 as non-NULL
when PyDict_SetItem() fails
taking True path
taking False path
when taking True path