[libvirt PATCH 1/1] qemu: Fix memory leaks in firmware selection code

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

 



Signed-off-by: Andrea Bolognani <abologna@xxxxxxxxxx>
---
 src/qemu/qemu_firmware.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/src/qemu/qemu_firmware.c b/src/qemu/qemu_firmware.c
index 9de4166772..b0f7ae5893 100644
--- a/src/qemu/qemu_firmware.c
+++ b/src/qemu/qemu_firmware.c
@@ -1296,6 +1296,8 @@ qemuFirmwareEnableFeaturesModern(virQEMUDriverConfig *cfg,
         loader = def->os.loader;
 
         loader->type = VIR_DOMAIN_LOADER_TYPE_ROM;
+
+        VIR_FREE(loader->path);
         loader->path = g_strdup(memory->filename);
 
         VIR_DEBUG("decided on loader '%s'",
@@ -1474,6 +1476,8 @@ qemuFirmwareFillDomainLegacy(virQEMUDriver *driver,
 
         loader->type = VIR_DOMAIN_LOADER_TYPE_PFLASH;
         loader->readonly = VIR_TRISTATE_BOOL_YES;
+
+        VIR_FREE(loader->nvramTemplate);
         loader->nvramTemplate = g_strdup(cfg->firmwares[i]->nvram);
 
         qemuFirmwareEnsureNVRAM(def, cfg, VIR_STORAGE_FILE_RAW);
-- 
2.39.2




[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