Re: [PATCH v1 1/2] entry.c: update cache entry only for existing files
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Oct 5, 2017, 11:19 UTC
- Message-ID
- <xmqqk2097sge.fsf@gitster.mtv.corp.google.com>
- In-Reply-To
- <20171005104407.65948-2-lars.schneider@autodesk.com>
lars.schneider@autodesk.com writes:
Show 13 quoted lines
> diff --git a/entry.c b/entry.c
> index 1c7e3c11d5..5dab656364 100644
> --- a/entry.c
> +++ b/entry.c
> @@ -304,7 +304,7 @@ static int write_entry(struct cache_entry *ce,
> ce->name, new, size, &buf, dco);
> if (ret && string_list_has_string(&dco->paths, ce->name)) {
> free(new);
> - goto finish;
> + goto delayed;
> }
> } else
> ret = convert_to_working_tree(This is unrelated to the main topic of this patch, but we see this just before the precontext of this hunk:
if (dco && dco->state != CE_NO_DELAY) {
/* Do not send the blob in case of a retry. */
if (dco->state == CE_RETRY) {
new = NULL;
size = 0;
}
ret = async_convert_to_working_tree(
ce->name, new, size, &buf, dco);Aren't we leaking "new" in that CE_RETRY case?