Skip to content

Commit da00334

Browse files
committed
fixed segmentation fault
1 parent e1ee0be commit da00334

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

src/install.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -483,9 +483,7 @@ int free_pkg(struct package* pkg) {
483483
free(pkg->optional);
484484
}
485485
if (pkg->files) {
486-
for (int i = 0; i < pkg->filesCount; i++) {
487-
if (pkg->files[i] != NULL) free(pkg->files[i]);
488-
}
486+
if (*pkg->files) free(*pkg->files);
489487
free(pkg->files);
490488
}
491489
return 0;

0 commit comments

Comments
 (0)