diff mbox series

[libubootenv] BUG: variable lists not released in close()

Message ID 20200217152651.18855-1-sbabic@denx.de
State Accepted
Headers show
Series [libubootenv] BUG: variable lists not released in close() | expand

Commit Message

Stefano Babic Feb. 17, 2020, 3:26 p.m. UTC
The list is not released in the close and this cause a segfault if the
same context is reused (as it is supposed to be). Segfault does not
happen if the context is released and a new one is created.

Signed-off-by: Stefano Babic <sbabic@denx.de>
---
 src/uboot_env.c | 1 +
 1 file changed, 1 insertion(+)
diff mbox series

Patch

diff --git a/src/uboot_env.c b/src/uboot_env.c
index 8926373..d619ee0 100644
--- a/src/uboot_env.c
+++ b/src/uboot_env.c
@@ -1369,6 +1369,7 @@  void libuboot_close(struct uboot_ctx *ctx) {
 			free(e->name);
 		if (e->value)
 			free(e->value);
+		LIST_REMOVE(e, next);
 		free(e);
 	}
 }