handle errors when constructing lists in the Python bindings
authorDavid Malcolm <dmalcolm@redhat.com>
Fri, 16 Dec 2011 03:24:19 +0000 (22:24 -0500)
committerAles Kozumplik <akozumpl@redhat.com>
Wed, 21 Dec 2011 07:45:52 +0000 (08:45 +0100)
commit3157d6d7b742d28dc321e4d68342809645a93207
treeca37759250ee10638b8fe8c1b43ecbb7f398d059
parent59807943af5c10c892b239f11b8fafb209254a4a
handle errors when constructing lists in the Python bindings

- Various functions in the Python bindings construct lists of objects, but
  assume that all calls succeed. Each of these could segfault under
  low-memory conditions: if the PyList_New() call fails,
  PyList_Append(NULL, item ) will segfault. Similarly, although
  Py_List_Append(list, NULL) is safe, Py_DECREF(NULL) will segfault.

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