mirror of https://github.com/TheAlgorithms/C
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)
|
||||
{
|
||||
perror("Unable to open file 'num.txt'.");
|
||||
free(txt_buffer);
|
||||
free(sum);
|
||||
free(number);
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue