From: Ján Tomko Date: Mon, 26 Aug 2013 10:51:08 +0000 (+0200) Subject: Don't free NULL network in cmdNetworkUpdate X-Git-Tag: v1.1.2-rc1~36 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=784cca89c51fd13383064f248a6b375fb34e516f;p=thirdparty%2Flibvirt.git 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 --- diff --git a/tools/virsh-network.c b/tools/virsh-network.c index e1baf0b332..06bf483926 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;