wc: Remove a memory leak.

This commit is contained in:
Emanuele Torre 2021-01-12 00:58:07 +01:00 committed by Andreas Kling
parent dcd259a100
commit 9dc44bf8c4
Notes: sideshowbarker 2024-07-18 23:54:28 +09:00

View File

@ -85,6 +85,10 @@ static Count get_count(const String& file_specifier)
count.words++;
}
}
if (file_pointer != stdin)
fclose(file_pointer);
return count;
}