Re: [PATCH 54/83] builtin/apply: make parse_chunk() return a negative integer on error

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sun, Apr 24, 2016 at 9:33 AM, Christian Couder
<christian.couder@xxxxxxxxx> wrote:
> This negative number can be -2 if no patch header has been found,
> otherwise it is -1.
>
> As parse_chunk() is called only by apply_patch() which already
> returns -1 when an error happened, let's make it return -1 when
> parse_chunk() returns -1.
>
> Signed-off-by: Christian Couder <chriscool@xxxxxxxxxxxxx>
> ---
> diff --git a/builtin/apply.c b/builtin/apply.c
> @@ -4566,6 +4567,8 @@ static int apply_patch(struct apply_state *state,
>                 nr = parse_chunk(state, buf.buf + offset, buf.len - offset, patch);
>                 if (nr < 0) {
>                         free_patch(patch);
> +                       if (nr == -1)
> +                               return -1;

Same comment as 51/83 about this leaking 'list', 'buf', and 'fn_table'.

>                         break;
>                 }
>                 if (state->apply_in_reverse)
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]