Commit Diff
- Commit:
565f18a82d800171c586b1877798c6e794b56505
- From:
- Omar Polo <op@omarpolo.com>
- 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 @@ -752,8 +752,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);