xenConfigGetString returns a newly-allocated pointer and it has to be
freed by the caller.
Signed-off-by: Fabiano FidĂȘncio <fidencio(a)redhat.com>
---
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