fix memory leaks in invocations of PyObject_Call
authorDavid Malcolm <dmalcolm@redhat.com>
Fri, 16 Dec 2011 03:22:56 +0000 (22:22 -0500)
committerAles Kozumplik <akozumpl@redhat.com>
Wed, 21 Dec 2011 07:45:52 +0000 (08:45 +0100)
commit59807943af5c10c892b239f11b8fafb209254a4a
treef32d8f33d7db8d7d165b36235f152539dc373f8f
parentead20c495c52bacfb5fd7fd796bee0fb56981c52
fix memory leaks in invocations of PyObject_Call

- Various functions in the Python bindings have expressions of the form:

  PyObject_Call(callable,
                  Py_BuildValue(fmtstring, ...), NULL);

  This leaks memory for the case when Py_BuildValue succeeds (it returns a
  new reference, which is never freed; PyObject_Call doesn't steal the
  reference): the argument tuple and all of its components will not be
  freed (until the process exits).

Signed-off-by: Ales Kozumplik <akozumpl@redhat.com>
python/header-py.c
python/rpmfd-py.c