commit 991857c7d6b96717f24bc49df50e8aacf12b02cf from: Omar Polo via: Thomas Adam date: Fri Apr 14 16:27:25 2023 UTC free fileindex entry upon add_entry() failure Very unlikely (an occurrence of it would mean that got produced an invalid fileindex) and harmless anyway since we would just terminate, but a leak is still a leak. ok stsp@ commit - 3f0853b8457683a6da4e0da74f8c08e139aad5ab commit + 991857c7d6b96717f24bc49df50e8aacf12b02cf blob - d4c9afde62a51e665fa0dd2cf7b6be7d576876e6 blob + ea52f0b95b730a506409d1fee9c8f88c42b9ca11 --- lib/fileindex.c +++ lib/fileindex.c @@ -749,8 +749,10 @@ got_fileindex_read(struct got_fileindex *fileindex, FI if (err) return err; err = add_entry(fileindex, ie); - if (err) + if (err) { + got_fileindex_entry_free(ie); return err; + } } n = fread(sha1_expected, 1, sizeof(sha1_expected), infile);