[PULL,2/5] util/module: fix a memory leak
diff mbox series

Message ID 20200108160233.991134-3-laurent@vivier.eu
State New
Headers show
Series
  • [PULL,1/5] MAINTAINERS: Update Yuval Shaia's email address
Related show

Commit Message

Laurent Vivier Jan. 8, 2020, 4:02 p.m. UTC
From: Pan Nengyuan <pannengyuan@huawei.com>

spotted by ASAN

Fixes: 81d8ccb1bea4fb9eaaf4c8e30bd4021180a9a39f
Reported-by: Euler Robot <euler.robot@huawei.com>
Signed-off-by: Pan Nengyuan <pannengyuan@huawei.com>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
Message-Id: <1576805650-16380-1-git-send-email-pannengyuan@huawei.com>
Signed-off-by: Laurent Vivier <laurent@vivier.eu>
---
 util/module.c | 1 +
 1 file changed, 1 insertion(+)

Patch
diff mbox series

diff --git a/util/module.c b/util/module.c
index e9fe3e5422ad..8c5315a7a307 100644
--- a/util/module.c
+++ b/util/module.c
@@ -214,6 +214,7 @@  bool module_load_one(const char *prefix, const char *lib_name)
 
     if (!success) {
         g_hash_table_remove(loaded_modules, module_name);
+        g_free(module_name);
     }
 
     for (i = 0; i < n_dirs; i++) {