`ls`: fix memory leak from not freeing the directory.

master
Drake 3 years ago
parent e67b7064d7
commit ad598c70f9

@ -94,6 +94,8 @@ static int listDirs(char *thatpath, bool specpath, bool colour, bool showdot,
count++;
}
}
free(dirp);
free(dp);
qsort(words, count - 1, sizeof(words), cmp);
char oldwd[PATH_MAX];
strcpy(oldwd, wd);

Loading…
Cancel
Save