]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
qemuProcessHandleGraphics: no need to check for NULL
authorPavel Hrdina <phrdina@redhat.com>
Fri, 13 Nov 2020 09:25:23 +0000 (10:25 +0100)
committerPavel Hrdina <phrdina@redhat.com>
Mon, 16 Nov 2020 16:25:41 +0000 (17:25 +0100)
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
src/qemu/qemu_process.c

index e2a3d87527d18a6631e3450a95f3162287edaf6b..579b3c3713c5ebb5761a6a9e643778092d41ba1c 100644 (file)
@@ -1105,24 +1105,20 @@ qemuProcessHandleGraphics(qemuMonitorPtr mon G_GNUC_UNUSED,
     return 0;
 
  error:
-    if (localAddr) {
-        VIR_FREE(localAddr->service);
-        VIR_FREE(localAddr->node);
-        VIR_FREE(localAddr);
-    }
-    if (remoteAddr) {
-        VIR_FREE(remoteAddr->service);
-        VIR_FREE(remoteAddr->node);
-        VIR_FREE(remoteAddr);
-    }
-    if (subject) {
-        for (i = 0; i < subject->nidentity; i++) {
-            VIR_FREE(subject->identities[i].type);
-            VIR_FREE(subject->identities[i].name);
-        }
-        VIR_FREE(subject->identities);
-        VIR_FREE(subject);
+    VIR_FREE(localAddr->service);
+    VIR_FREE(localAddr->node);
+    VIR_FREE(localAddr);
+
+    VIR_FREE(remoteAddr->service);
+    VIR_FREE(remoteAddr->node);
+    VIR_FREE(remoteAddr);
+
+    for (i = 0; i < subject->nidentity; i++) {
+        VIR_FREE(subject->identities[i].type);
+        VIR_FREE(subject->identities[i].name);
     }
+    VIR_FREE(subject->identities);
+    VIR_FREE(subject);
 
     return -1;
 }