[Buildroot] [PATCH 1/2] Duplicate efi slot bootname to avoid double free

Rhidian De Wit <[email protected]>
Newsgroups net.busybox.buildroot
Message-ID <[email protected]>
Signed-off-by: Rhidian De Wit <[email protected]>
---
 src/bootloaders/efi.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/bootloaders/efi.c b/src/bootloaders/efi.c
index 889ccca4..631ea39d 100644
--- a/src/bootloaders/efi.c
+++ b/src/bootloaders/efi.c
@@ -513,7 +513,7 @@ gchar *r_efi_get_current_bootname(RaucConfig *config, GError **error)
 	g_hash_table_iter_init(&iter, config->slots);
 	while (g_hash_table_iter_next(&iter, NULL, (gpointer*) &slot)) {
 		if (g_strcmp0(slot->bootname, bootcurrent->name) == 0) {
-			return slot->bootname;
+			return g_strdup(slot->bootname);
 		}
 	}
 
-- 
2.51.0

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.