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

[libvirt] [PATCH] Fix a memory leak in the qemudBuildCommandLine.



ADD_ARG_LIT should only be used for literal arguments,
since it duplicates the memory.  Since virBufferContentAndReset
is already allocating memory, we should only use ADD_ARG.

Signed-off-by: Chris Lalancette <clalance redhat com>
---
 src/qemu/qemu_conf.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/src/qemu/qemu_conf.c b/src/qemu/qemu_conf.c
index 172986e..d0655fd 100644
--- a/src/qemu/qemu_conf.c
+++ b/src/qemu/qemu_conf.c
@@ -4110,7 +4110,7 @@ int qemudBuildCommandLine(virConnectPtr conn,
                 goto error;
             }
 
-            ADD_ARG_LIT(virBufferContentAndReset(&boot_buf));
+            ADD_ARG(virBufferContentAndReset(&boot_buf));
         }
 
         if (def->os.kernel) {
-- 
1.7.1.1


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