diff mbox series

[OpenWrt-Devel,libubox,6/9] jshn: main: fix leak of memory pointed to by 'vars'

Message ID 20191120115926.23272-7-ynezz@true.cz
State Superseded
Headers show
Series fixes, some unit tests and GitLab CI | expand

Commit Message

Petr Štetiar Nov. 20, 2019, 11:59 a.m. UTC
Fixes following leak of memory:

 6,016 bytes in 1 blocks are possibly lost in loss record 1 of 1
    at 0x4C31B25: calloc
    by 0x1098F8: main (jshn.c:353)

Signed-off-by: Petr Štetiar <ynezz@true.cz>
---
 jshn.c | 1 +
 1 file changed, 1 insertion(+)
diff mbox series

Patch

diff --git a/jshn.c b/jshn.c
index 0aa120c925dd..02b35286ea8b 100644
--- a/jshn.c
+++ b/jshn.c
@@ -366,6 +366,7 @@  int main(int argc, char **argv)
 		vars[i].val = c + 1;
 		avl_insert(&env_vars, &vars[i].avl);
 	}
+	free(vars);
 
 	while ((ch = getopt(argc, argv, "p:nir:R:o:w")) != -1) {
 		switch(ch) {