From c42f11cc7c0f0ec6571af06ada6ff0e8882f4fde Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20=C5=A0tetiar?= Date: Tue, 19 Nov 2019 12:34:14 +0100 Subject: [PATCH] jshn: main: fix leak of memory pointed to by 'vars' MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- jshn.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/jshn.c b/jshn.c index 1efe254..2eebe6c 100644 --- a/jshn.c +++ b/jshn.c @@ -443,12 +443,15 @@ int main(int argc, char **argv) indent = true; break; default: + free(vars); return usage(argv[0]); } } + free(vars); return usage(argv[0]); exit: + free(vars); return ret; }