"Das U-Boot" Source Tree

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>

authored by

Maks Mishin and committed by
Tom Rini
4e18b47c 4545880c

+3
+3
tools/proftool.c
··· 676 676 if (!tok) { 677 677 error("Invalid trace config data on line %d\n", 678 678 linenum); 679 + free(line); 679 680 return -1; 680 681 } 681 682 if (0 == strcmp(tok, "include-func")) { ··· 685 686 } else { 686 687 error("Unknown command in trace config data line %d\n", 687 688 linenum); 689 + free(line); 688 690 return -1; 689 691 } 690 692 ··· 692 694 if (!tok) { 693 695 error("Missing pattern in trace config data line %d\n", 694 696 linenum); 697 + free(line); 695 698 return -1; 696 699 } 697 700