mokutil/0005-mokutil-Fix-memory-leak-in-export_db_keys.patch
liyuan 2d3946c7a5 backport mokutil: Fix memory leak in export_db_keys
(cherry picked from commit c96dfbb8a4e24a7a66597d2db463f99898fbafa0)
2024-05-25 17:27:25 +08:00

26 lines
608 B
Diff

From 71140ef59ac8f7bbe445fca2ba90a6833d3cb8c6 Mon Sep 17 00:00:00 2001
From: gaoyusong <a869920004@163.com>
Date: Thu, 22 Sep 2022 16:43:39 +0800
Subject: [PATCH] mokutil: Fix memory leak in export_db_keys
Signed-off-by: gaoyusong <a869920004@163.com>
---
src/mokutil.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/src/mokutil.c b/src/mokutil.c
index d445311..9e947d5 100644
--- a/src/mokutil.c
+++ b/src/mokutil.c
@@ -1233,6 +1233,7 @@ export_db_keys (const DBName db_name)
list = build_mok_list (data, data_size, &mok_num);
if (list == NULL) {
+ free(data);
return -1;
}
--
2.33.0