File: | tests/cpychecker/refcounts/object_leak/input.c |
Function: | object_leak |
Error: | ob_refcnt of PyLongObject is 1 too high |
22 PyObject *
23 object_leak(PyObject *self, PyObject *args)
24 {
25 /* Buggy code: create an object: */
26 PyObject *tmp = PyLong_FromLong(0x1000);
PyLong_FromLong() succeeds
PyLongObject allocated at: PyObject *tmp = PyLong_FromLong(0x1000);
27
28 /* Then throw it away, leaking the object (assuming the call succeeds) */
29 return NULL;
returning
ob_refcnt of PyLongObject is 1 too high
30 }