[OpenWrt-Devel] [PATCH v2 libubox 07/10] jshn: main: fix leak of memory pointed to by 'vars'

Petr Štetiar ynezz at true.cz
Wed Nov 20 16:43:50 EST 2019


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 at true.cz>
---
 jshn.c | 1 +
 1 file changed, 1 insertion(+)

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) {

_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


More information about the openwrt-devel mailing list