]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
qemuMonitorTextGetMemoryStats: plug a leak on an error path
authorJim Meyering <meyering@redhat.com>
Wed, 20 Jan 2010 17:24:47 +0000 (18:24 +0100)
committerJim Meyering <meyering@redhat.com>
Mon, 25 Jan 2010 16:04:27 +0000 (17:04 +0100)
* src/qemu/qemu_monitor_text.c (qemuMonitorCommandWithHandler):
Always free *reply, upon failure.

src/qemu/qemu_monitor_text.c

index 0909b4da3d20a12c6060a24e1eba1c2956a76cdc..ce5349bd712f4b0ed50a874c08d0fa155a154784 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * qemu_monitor_text.c: interaction with QEMU monitor console
  *
- * Copyright (C) 2006-2009 Red Hat, Inc.
+ * Copyright (C) 2006-2010 Red Hat, Inc.
  * Copyright (C) 2006 Daniel P. Berrange
  *
  * This library is free software; you can redistribute it and/or
@@ -235,9 +235,11 @@ qemuMonitorCommandWithHandler(qemuMonitorPtr mon,
         }
     }
 
-    if (ret < 0)
+    if (ret < 0) {
         virReportSystemError(NULL, msg.lastErrno,
                              _("cannot send monitor command '%s'"), cmd);
+        VIR_FREE(*reply);
+    }
 
     return ret;
 }