[libvirt] [PATCH] tools: Fix a wrong check in cmdEcho()

Hongwei Bi hwbi2008 at gmail.com
Tue Sep 17 06:21:32 UTC 2013


What should be checked here is xmlbuf rather then buf.
---
 tools/virsh.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/tools/virsh.c b/tools/virsh.c
index bf2fbf8..ac354ac 100644
--- a/tools/virsh.c
+++ b/tools/virsh.c
@@ -921,7 +921,7 @@ cmdEcho(vshControl *ctl, const vshCmd *cmd)
 
         if (xml) {
             virBufferEscapeString(&xmlbuf, "%s", arg);
-            if (virBufferError(&buf)) {
+            if (virBufferError(&xmlbuf)) {
                 vshPrint(ctl, "%s", _("Failed to allocate XML buffer"));
                 return false;
             }
-- 
1.7.1




More information about the libvir-list mailing list