PATCH [5/5]: pyblock: Add missing DECREF and fix error handling in pydmraid_raidset_get_map()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



pydmraid_raidset_get_map() was missing a DECREF for the imported module and
would return a non NULL value in case of error when the __init__ call failed.
---
 dmraid.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/dmraid.c b/dmraid.c
index 51d4ad6..23e1bbc 100644
--- a/dmraid.c
+++ b/dmraid.c
@@ -877,12 +877,13 @@ pydmraid_raidset_get_map(PyObject *self, void *data)

 	iret = PyObject_CallMethod(map, "__init__", "sO", rs->name, table);
 	if (!iret) {
-		Py_DECREF(map);
+		Py_CLEAR(map);
 		goto out;
 	}

 out:
 	Py_XDECREF(iret);
+	Py_XDECREF(m);
 	Py_XDECREF(table);
 	if (!map && !PyErr_Occurred()) {
 		if (errno != 0)
--
1.6.1.3

_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/anaconda-devel-list

[Index of Archives]     [Kickstart]     [Fedora Users]     [Fedora Legacy List]     [Fedora Maintainers]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]
  Powered by Linux