[PATCH sandbox 8/9] Remove bogus check for NULL in cleanup path

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

 



From: "Daniel P. Berrange" <berrange@xxxxxxxxxx>

The 'config' object in libvirt-sandbox-context-service.c
methods cannot be NULL, so checking 'if (config)' is
pointless code.

Signed-off-by: Daniel P. Berrange <berrange@xxxxxxxxxx>
---
 libvirt-sandbox/libvirt-sandbox-context-service.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/libvirt-sandbox/libvirt-sandbox-context-service.c b/libvirt-sandbox/libvirt-sandbox-context-service.c
index 0858ffb..b1ee311 100644
--- a/libvirt-sandbox/libvirt-sandbox-context-service.c
+++ b/libvirt-sandbox/libvirt-sandbox-context-service.c
@@ -179,8 +179,7 @@ cleanup:
         g_object_unref(builder);
     if (connection)
         g_object_unref(connection);
-    if (config)
-        g_object_unref(config);
+    g_object_unref(config);
 
     return ret;
 }
@@ -265,8 +264,7 @@ cleanup:
         g_object_unref(builder);
     if (connection)
         g_object_unref(connection);
-    if (config)
-        g_object_unref(config);
+    g_object_unref(config);
     return ret;
 }
 
-- 
1.8.3.1

--
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]