Free memory allocated
This commit is contained in:
parent
ea8f9f47e6
commit
fc0b626edf
1 changed files with 4 additions and 0 deletions
4
wc.c
4
wc.c
|
@ -104,6 +104,10 @@ void wc(char **list, int count) {
|
|||
printf("%*d ", intlen(items[TOTAL][MLLEN]), items[TOTAL][MLLEN]);
|
||||
printf("total\n");
|
||||
}
|
||||
for (int i = 0; i < count; i++) {
|
||||
free(items[i]);
|
||||
}
|
||||
free(items);
|
||||
}
|
||||
|
||||
int main(int argc, char **argv) {
|
||||
|
|
Loading…
Add table
Reference in a new issue