[libvirt] [PATCH 1/2] Fix memory leak in set_other_id_info

Adam Majer amajer at suse.de
Tue Jan 9 12:20:37 UTC 2018


model was allocated by asprintf but never freed after usage
and assignment.

Signed-off-by: Adam Majer <amajer at suse.de>
---
 src/Virt_ComputerSystem.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/src/Virt_ComputerSystem.c b/src/Virt_ComputerSystem.c
index da07f93..b4930ac 100644
--- a/src/Virt_ComputerSystem.c
+++ b/src/Virt_ComputerSystem.c
@@ -417,6 +417,8 @@ static int set_other_id_info(const CMPIBroker *broker,
                                     CMPI_string);
         }
 
+        free(model);
+
         CMSetProperty(instance, "OtherIdentifyingInfo",
                       &id_info, CMPI_stringA);
 
-- 
2.13.6




More information about the libvir-list mailing list