[PATCH] virsh: don't call virSecretFree on NULL

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

 



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
---
 tools/virsh-secret.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/tools/virsh-secret.c b/tools/virsh-secret.c
index ea0b0c3..7201522 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;
 }
 
-- 
1.8.1.5

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]