mirror of
https://github.moeyy.xyz/https://github.com/TheAlgorithms/C.git
synced 2023-10-11 15:56:24 +08:00
fix possible memory leak
This commit is contained in:
parent
f58916f8f5
commit
39cdc7b108
@ -140,6 +140,9 @@ numbers. For safety, we make it twice the length of a number. */
|
|||||||
if (!fp)
|
if (!fp)
|
||||||
{
|
{
|
||||||
perror("Unable to open file 'num.txt'.");
|
perror("Unable to open file 'num.txt'.");
|
||||||
|
free(txt_buffer);
|
||||||
|
free(sum);
|
||||||
|
free(number);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user