tools: proftool: Fix potential memory leaks
PATCH 1/1 tools: proftool: Fix potential memory leaks
Dynamic memory, referenced by 'line', is allocated by calling function 'calloc' and lost when the function terminates with code -1.
Signed-off-by Maks Mishin <[email protected]>
--- tools/proftool.c | 3 +++ 1 file changed, 3 insertions(+)
tools/proftool.c +3 -0
@@ -676,6 +676,7 @@ static int read_trace_config(FILE *fin)if (!tok) {error ("Invalid trace config data on line %d\n" , linenum); +free (line);return -1 ; }if (0 ==strcmp (tok,"include-func" )) {
@@ -685,6 +686,7 @@ static int read_trace_config(FILE *fin) }else {error ("Unknown command in trace config data line %d\n" , linenum); +free (line);return -1 ; }
@@ -692,6 +694,7 @@ static int read_trace_config(FILE *fin)if (!tok) {error ("Missing pattern in trace config data line %d\n" , linenum); +free (line);return -1 ; }
Signature · 1 line
2.34.1
Quoted 4 lines · Maks Mishin
Dynamic memory, referenced by 'line', is allocated by calling function 'calloc' and lost when the function terminates with code -1.
Applied to u-boot/next, thanks!
Signature · 1 line
Tom