free line on error in loop

This commit is contained in:
Chris Cromer 2021-06-19 20:32:26 -04:00
parent b5e4de3f82
commit 21448cee37
1 changed files with 3 additions and 0 deletions

View File

@ -46,6 +46,9 @@ void loop() {
else {
perror("Error: ");
printf("\n");
if (line != NULL) {
free(line);
}
exit(EXIT_FAILURE);
}
}