Blob Blame History Raw
From d49b62fca1ec33a7feed94ce6f44995164d83872 Mon Sep 17 00:00:00 2001
Message-Id: <d49b62fca1ec33a7feed94ce6f44995164d83872.1377873641.git.jdenemar@redhat.com>
From: =?UTF-8?q?J=C3=A1n=20Tomko?= <jtomko@redhat.com>
Date: Mon, 26 Aug 2013 16:01:43 +0200
Subject: [PATCH] Don't free NULL network in cmdNetworkUpdate

If the network has not been found, virNetworkFree(NULL)
was called, resulting in an extra error:
error: invalid network pointer in virNetworkFree

https://bugzilla.redhat.com/show_bug.cgi?id=1001094

(cherry picked from commit 784cca89c51fd13383064f248a6b375fb34e516f)
---
 tools/virsh-network.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/virsh-network.c b/tools/virsh-network.c
index e1baf0b..06bf483 100644
--- a/tools/virsh-network.c
+++ b/tools/virsh-network.c
@@ -918,7 +918,7 @@ cmdNetworkUpdate(vshControl *ctl, const vshCmd *cmd)
     const char *affected;
 
     if (!(network = vshCommandOptNetwork(ctl, cmd, NULL)))
-        goto cleanup;
+        return false;
 
     if (vshCommandOptStringReq(ctl, cmd, "command", &commandStr) < 0)
         goto cleanup;
-- 
1.8.3.2