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

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



From: "Daniel P. Berrange" <berrange redhat com>

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 redhat com>
---
 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


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