File: | netifaces.c |
Function: | add_to_family |
Error: | ob_refcnt of '*dict' is 1 too low |
327 static int
328 add_to_family (PyObject *result, int family, PyObject *dict)
329 {
330 PyObject *py_family = PyInt_FromLong (family);
when PyInt_FromLong() succeeds
331 PyObject *list = PyDict_GetItem (result, py_family);
when PyDict_GetItem() succeeds
332
333 if (!py_family) {
taking False path
334 Py_DECREF (dict);
335 Py_XDECREF (list);
336 return FALSE;
337 }
338
339 if (!list) {
taking False path
340 list = PyList_New (1);
341 if (!list) {
342 Py_DECREF (dict);
343 Py_DECREF (py_family);
344 return FALSE;
345 }
346
347 PyList_SET_ITEM (list, 0, dict);
348 PyDict_SetItem (result, py_family, list);
349 Py_DECREF (list);
350 } else {
351 PyList_Append (list, dict);
when treating ob_size as 0
when PyList_Append() succeeds
ob_refcnt is now refs: 1 + N where N >= 1
'*dict' is now referenced by 1 non-stack value(s): borrowed reference returned by PyDict_GetItem().ob_item[0]
352 Py_DECREF (dict);
taking True path
ob_refcnt is now refs: 0 + N where N >= 1
353 }
354
355 return TRUE;
356 }
ob_refcnt of '*dict' is 1 too low
was expecting final ob_refcnt to be N + 1 (for some unknown N)
due to object being referenced by: borrowed reference returned by PyDict_GetItem().ob_item[0]
but final ob_refcnt is N + 0
found 9 similar trace(s) to this
File: | netifaces.c |
Function: | add_to_family |
Error: | ob_refcnt of '*py_family' is 1 too high |
327 static int
328 add_to_family (PyObject *result, int family, PyObject *dict)
329 {
330 PyObject *py_family = PyInt_FromLong (family);
when PyInt_FromLong() succeeds
PyIntObject allocated at: PyObject *py_family = PyInt_FromLong (family);
ob_refcnt is now refs: 1 + N where N >= 0
331 PyObject *list = PyDict_GetItem (result, py_family);
when PyDict_GetItem() succeeds
332
333 if (!py_family) {
taking False path
334 Py_DECREF (dict);
335 Py_XDECREF (list);
336 return FALSE;
337 }
338
339 if (!list) {
taking False path
340 list = PyList_New (1);
341 if (!list) {
342 Py_DECREF (dict);
343 Py_DECREF (py_family);
344 return FALSE;
345 }
346
347 PyList_SET_ITEM (list, 0, dict);
348 PyDict_SetItem (result, py_family, list);
349 Py_DECREF (list);
350 } else {
351 PyList_Append (list, dict);
when treating ob_size as 0
when PyList_Append() succeeds
352 Py_DECREF (dict);
taking True path
353 }
354
355 return TRUE;
356 }
ob_refcnt of '*py_family' 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 5 similar trace(s) to this
File: | netifaces.c |
Function: | add_to_family |
Error: | calling PyDict_GetItem with NULL as argument 2 (py_family) at netifaces.c:331 |
327 static int
328 add_to_family (PyObject *result, int family, PyObject *dict)
329 {
330 PyObject *py_family = PyInt_FromLong (family);
when PyInt_FromLong() fails
331 PyObject *list = PyDict_GetItem (result, py_family);
calling PyDict_GetItem with NULL as argument 2 (py_family) at netifaces.c:331
PyDict_GetItem() invokes Py_TYPE() on the pointer via the PyString_CheckExact() macro, thus accessing (NULL)->ob_type
332
333 if (!py_family) {
334 Py_DECREF (dict);
335 Py_XDECREF (list);
336 return FALSE;
337 }
338
339 if (!list) {
340 list = PyList_New (1);
341 if (!list) {
342 Py_DECREF (dict);
343 Py_DECREF (py_family);
344 return FALSE;
345 }
346
347 PyList_SET_ITEM (list, 0, dict);
348 PyDict_SetItem (result, py_family, list);
349 Py_DECREF (list);
350 } else {
351 PyList_Append (list, dict);
352 Py_DECREF (dict);
353 }
354
355 return TRUE;
356 }