render / rpms / libvirt

Forked from rpms/libvirt 9 months ago
Clone
b35f2b
From 8ad6e3bc6d3e9e55093b546ee886a2a2d9e875f5 Mon Sep 17 00:00:00 2001
b35f2b
Message-Id: <8ad6e3bc6d3e9e55093b546ee886a2a2d9e875f5@dist-git>
b35f2b
From: Michal Privoznik <mprivozn@redhat.com>
b35f2b
Date: Fri, 21 May 2021 14:16:13 +0200
b35f2b
Subject: [PATCH] domain_conf: Don't leak def->os.firmwareFeatures
b35f2b
b35f2b
The firmwareFeatures member of virDomainOSDef struct is allocated
b35f2b
in virDomainDefParseBootFirmwareOptions() but never freed.
b35f2b
b35f2b
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
b35f2b
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
b35f2b
(cherry picked from commit c116b9481426f86188c71f340d5e3db103120bf8)
b35f2b
b35f2b
Conflicts:
b35f2b
    src/conf/domain_conf.c
b35f2b
        - missing upstream commits:
b35f2b
            77f8e48fc35eaf867eae4f623e381f87f6e29930
b35f2b
            f9f81f1c8f855b8c21aeae4441abfc877ff2bfc3
b35f2b
b35f2b
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1929357
b35f2b
b35f2b
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
b35f2b
Message-Id: <82f4beea71e682c43ec10370d5a43a608d1cb411.1621599207.git.phrdina@redhat.com>
b35f2b
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
b35f2b
---
b35f2b
 src/conf/domain_conf.c | 1 +
b35f2b
 1 file changed, 1 insertion(+)
b35f2b
b35f2b
diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
b35f2b
index 28c8d0ecbd..2ffa9c8a2a 100644
b35f2b
--- a/src/conf/domain_conf.c
b35f2b
+++ b/src/conf/domain_conf.c
b35f2b
@@ -3431,6 +3431,7 @@ void virDomainDefFree(virDomainDefPtr def)
b35f2b
     VIR_FREE(def->idmap.uidmap);
b35f2b
     VIR_FREE(def->idmap.gidmap);
b35f2b
 
b35f2b
+    VIR_FREE(def->os.firmwareFeatures);
b35f2b
     VIR_FREE(def->os.machine);
b35f2b
     VIR_FREE(def->os.init);
b35f2b
     for (i = 0; def->os.initargv && def->os.initargv[i]; i++)
b35f2b
-- 
b35f2b
2.31.1
b35f2b