Am 26.07.2013 14:56, schrieb Eli Bendersky: > Just a quick question - is there a chance to convince Coverity to detect > Python refcounting leaks in C API code :-) ? This could be useful not > only for Python but for extensions too. As it stands now, Coverity's > leak detection is Python must be pretty weak because almost everything > is done via PyObject refcounts.
Coverity is able to detect some cases of refcount leaks. I don't know if the software is able to keep track of all reference counts. But it understands missing Py_DECREF() in error branches. For example: PyObject *n = PyLong_FromLong(0); PyObject *u = PyUnicode_FromString("example"); if (u == NULL) { return NULL; /* Coverity detects that 'n' leaks memory */ } Christian _______________________________________________ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com