mirror of
https://source.denx.de/u-boot/u-boot.git
synced 2025-08-06 23:36:59 +02:00
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 <maks.mishinFZ@gmail.com>
This commit is contained in:
parent
4545880c3c
commit
4e18b47c73
@ -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;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user