[libvirt-python PATCH 03/23] remove useless check for NULL before Py_XDECREF

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

 



Signed-off-by: Pavel Hrdina <phrdina@xxxxxxxxxx>
---
 libvirt-override.c | 9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)

diff --git a/libvirt-override.c b/libvirt-override.c
index 14aa0e9..114104b 100644
--- a/libvirt-override.c
+++ b/libvirt-override.c
@@ -2303,12 +2303,9 @@ libvirt_virRegisterErrorHandler(ATTRIBUTE_UNUSED PyObject * self,
           pyobj_f);
 
     virSetErrorFunc(NULL, libvirt_virErrorFuncHandler);
-    if (libvirt_virPythonErrorFuncHandler != NULL) {
-        Py_XDECREF(libvirt_virPythonErrorFuncHandler);
-    }
-    if (libvirt_virPythonErrorFuncCtxt != NULL) {
-        Py_XDECREF(libvirt_virPythonErrorFuncCtxt);
-    }
+
+    Py_XDECREF(libvirt_virPythonErrorFuncHandler);
+    Py_XDECREF(libvirt_virPythonErrorFuncCtxt);
 
     if ((pyobj_f == Py_None) && (pyobj_ctx == Py_None)) {
         libvirt_virPythonErrorFuncHandler = NULL;
-- 
2.5.3

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list



[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]