Re: [PATCH 69/83] builtin/apply: make add_conflicted_stages_file() return -1 on error
- From
Eric Sunshine <sunshine@sunshineco.com>
- Date
- May 2, 2016, 07:36 UTC
- Message-ID
- <CAPig+cRBgj29ugY0qYS9eB09CDKcJXeBKg3KqPaoZFSzCwftZw@mail.gmail.com>
- In-Reply-To
- <1461504863-15946-70-git-send-email-chriscool@tuxfamily.org>
On Sun, Apr 24, 2016 at 9:34 AM, Christian Couder <christian.couder@gmail.com> wrote:
Show 10 quoted lines
> Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
> ---
> diff --git a/builtin/apply.c b/builtin/apply.c
> @@ -4234,8 +4234,11 @@ static void add_conflicted_stages_file(struct apply_state *state,
> ce->ce_namelen = namelen;
> hashcpy(ce->sha1, patch->threeway_stage[stage - 1].hash);
> if (add_cache_entry(ce, ADD_CACHE_OK_TO_ADD) < 0)
> - die(_("unable to add cache entry for %s"), patch->new_name);
> + return error(_("unable to add cache entry for %s"),
> + patch->new_name);Is this leaking 'ce' (which is allocated a few lines above the shown context)?
> } > + > + return 0; > }