mirror of
https://source.denx.de/u-boot/u-boot.git
synced 2025-08-09 16:56:58 +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) {
|
if (!tok) {
|
||||||
error("Invalid trace config data on line %d\n",
|
error("Invalid trace config data on line %d\n",
|
||||||
linenum);
|
linenum);
|
||||||
|
free(line);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
if (0 == strcmp(tok, "include-func")) {
|
if (0 == strcmp(tok, "include-func")) {
|
||||||
@ -685,6 +686,7 @@ static int read_trace_config(FILE *fin)
|
|||||||
} else {
|
} else {
|
||||||
error("Unknown command in trace config data line %d\n",
|
error("Unknown command in trace config data line %d\n",
|
||||||
linenum);
|
linenum);
|
||||||
|
free(line);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -692,6 +694,7 @@ static int read_trace_config(FILE *fin)
|
|||||||
if (!tok) {
|
if (!tok) {
|
||||||
error("Missing pattern in trace config data line %d\n",
|
error("Missing pattern in trace config data line %d\n",
|
||||||
linenum);
|
linenum);
|
||||||
|
free(line);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user