[libvirt PATCH v6 10/15] xen_common: Adapt xenParseGeneralMeta due to changes in xenConfigGetString

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

 



xenConfigGetString returns a newly-allocated pointer and it has to be
freed by the caller.

Signed-off-by: Fabiano Fidêncio <fidencio@xxxxxxxxxx>
---
 src/xenconfig/xen_common.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/xenconfig/xen_common.c b/src/xenconfig/xen_common.c
index 5d88577222..09f93ba449 100644
--- a/src/xenconfig/xen_common.c
+++ b/src/xenconfig/xen_common.c
@@ -1083,7 +1083,7 @@ static int
 xenParseGeneralMeta(virConfPtr conf, virDomainDefPtr def, virCapsPtr caps)
 {
     virCapsDomainDataPtr capsdata = NULL;
-    const char *str;
+    const char *str = NULL;
     int hvm = 0, ret = -1;
 
     if (xenConfigCopyString(conf, "name", &def->name) < 0)
@@ -1108,6 +1108,7 @@ xenParseGeneralMeta(virConfPtr conf, virDomainDefPtr def, virCapsPtr caps)
 
     ret = 0;
  out:
+    VIR_FREE(str);
     VIR_FREE(capsdata);
     return ret;
 }
-- 
2.17.1

--
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]

  Powered by Linux