commit 6b798c3c8a2a1a0b86a2e6fbbe3d3be758f9b56c from: Stefan Sperling date: Tue Jan 08 21:22:53 2019 UTC don't forgot to free file index entries in got_fileindex_free() commit - b504a804cf269d86aebf0f805cc5eb135423f76a commit + 6b798c3c8a2a1a0b86a2e6fbbe3d3be758f9b56c blob - 20cc091e54b2160f436901349992bfba5394f004 blob + d0d1be448ea98d718d4cb76352f3fc9bc41de44a --- lib/fileindex.c +++ lib/fileindex.c @@ -155,9 +155,18 @@ got_fileindex_alloc(struct got_fileindex **fileindex) return NULL; } +static const struct got_error * +free_entry_cb(const char *path, void *data, void *arg) +{ + struct got_fileindex_entry *entry = data; + got_fileindex_entry_free(entry); + return NULL; +} + void got_fileindex_free(struct got_fileindex *fileindex) { + got_pathset_for_each_safe(fileindex->entries, free_entry_cb, NULL); got_pathset_free(fileindex->entries); free(fileindex); }