Commit Diff
- Commit:
991857c7d6b96717f24bc49df50e8aacf12b02cf
- From:
- Omar Polo <op@omarpolo.com>
- Via:
- Thomas Adam <thomas@xteddy.org>
- Date:
- Message:
- 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@
- Actions:
- Patch | Tree
--- 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);