Skip to content

Commit

Permalink
Fix invalid free() bug when processing single file
Browse files Browse the repository at this point in the history
Signed-off-by: Anestis Bechtsoudis <anestis@census-labs.com>
  • Loading branch information
anestisb committed Feb 18, 2018
1 parent e6ace98 commit c83d738
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/vdexExtractor.c
Original file line number Diff line number Diff line change
Expand Up @@ -282,8 +282,10 @@ int main(int argc, char **argv) {
mainRet = EXIT_SUCCESS;

complete:
for (size_t i = 0; i < pFiles.fileCnt; i++) {
free(pFiles.files[i]);
if (pFiles.fileCnt > 1) {
for (size_t i = 0; i < pFiles.fileCnt; i++) {
free(pFiles.files[i]);
}
}
free(pFiles.files);
exitWrapper(mainRet);
Expand Down

0 comments on commit c83d738

Please sign in to comment.