On Thu, Aug 05, 2021 at 17:34:20 +0200, Peter Krempa wrote:
Previously they were stored in two separate arrays. This way
it's
obvious when referencing the same one.
Signed-off-by: Peter Krempa <pkrempa(a)redhat.com>
---
src/qemu/qemu_command.c | 4 ++--
src/qemu/qemu_domain.c | 45 +++++++++++++++++++++++------------------
src/qemu/qemu_domain.h | 9 +++++++--
3 files changed, 34 insertions(+), 24 deletions(-)
[...]
diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c
index 6f8c93ea0c..21668cae4c 100644
--- a/src/qemu/qemu_domain.c
+++ b/src/qemu/qemu_domain.c
@@ -3319,12 +3319,17 @@ virDomainXMLPrivateDataCallbacks
virQEMUDriverPrivateDataCallbacks = {
static void
qemuDomainXmlNsDefFree(qemuDomainXmlNsDef *def)
{
+ size_t i;
+
if (!def)
return;
+ for (i = 0; i < def->num_env; i++) {
+ g_free(def->env[i].name);
+ g_free(def->env[i].value);
+ }
+
virStringListFreeCount(def->args, def->num_args);
Consider the following squashed in:
diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c
index f5d4db33bf..bc448e48a4 100644
--- a/src/qemu/qemu_domain.c
+++ b/src/qemu/qemu_domain.c
@@ -3328,6 +3328,7 @@ qemuDomainXmlNsDefFree(qemuDomainXmlNsDef *def)
g_free(def->env[i].name);
g_free(def->env[i].value);
}
+ g_free(def->env);
g_strfreev(def->args);
g_strfreev(def->capsadd);