Open davidmalcolm opened 7 years ago
CPyChecker warns that "ob_refcnt of PyBool_FromLong is 1 too high" in code like this:
PyObject_CallMethod(obj, "methodname", "N", PyBool_FromLong(0));
In fact, the "N" specifier means that PyObject_CallMethod steals the reference if the return value of PyBool_FromLong is non-NULL.
Imported from trac issue 55. Created by emptysquare on 2014-01-29T15:58:04, last modified: 2014-01-29T15:58:04
CPyChecker warns that "ob_refcnt of PyBool_FromLong is 1 too high" in code like this:
PyObject_CallMethod(obj, "methodname", "N", PyBool_FromLong(0));
In fact, the "N" specifier means that PyObject_CallMethod steals the reference if the return value of PyBool_FromLong is non-NULL.