Re: [PATCHv2 3/4] bundle: don't leak an fd in case of early return
- From
Jeff King <peff@peff.net>
- Date
- Mar 30, 2016, 17:23 UTC
- Message-ID
- <20160330172354.GB19675@sigill.intra.peff.net>
- In-Reply-To
- <1459357518-14913-4-git-send-email-sbeller@google.com>
On Wed, Mar 30, 2016 at 10:05:17AM -0700, Stefan Beller wrote:
Show 9 quoted lines
> diff --git a/bundle.c b/bundle.c > index 506ac49..fbc8593 100644 > --- a/bundle.c > +++ b/bundle.c > @@ -407,6 +407,7 @@ int create_bundle(struct bundle_header *header, const char *path, > int bundle_to_stdout; > int ref_count = 0; > struct rev_info revs; > + int ret = -1;
A minor nit, but I don't think we ever put anything but "-1" in this variable. It could go away and we can just "return -1" in the "err" path.
-Peff