From: Ján Tomko Date: Fri, 29 Mar 2013 11:55:38 +0000 (+0100) Subject: virsh: don't call virSecretFree on NULL X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=bfb4b822579ce1afcbc396fe4bc3b57fb3ebc150;p=libvirt.git virsh: don't call virSecretFree on NULL Since the refactoring in fbe2d49 we call virSecretFree even if virSecretDefineXML fails, which leads to overwriting the error message with: error: Invalid secret: virSecretFree Bug: https://bugzilla.redhat.com/show_bug.cgi?id=929045 --- diff --git a/tools/virsh-secret.c b/tools/virsh-secret.c index ea0b0c307f..72015229df 100644 --- a/tools/virsh-secret.c +++ b/tools/virsh-secret.c @@ -117,7 +117,8 @@ cmdSecretDefine(vshControl *ctl, const vshCmd *cmd) cleanup: VIR_FREE(buffer); - virSecretFree(res); + if (res) + virSecretFree(res); return ret; }