Re: [PATCH] builtin/apply: free patch when parse_chunk() fails

2016-04-01 Thread Junio C Hamano
Christian Couder writes: > When parse_chunk() fails it can return -1, for example > when find_header() doesn't find a patch header. > > In this case it's better in apply_patch() to free the > "struct patch" that we just allocated instead of > leaking it. > > Signed-off-by: Christian Couder > ---

Re: [PATCH] builtin/apply: free patch when parse_chunk() fails

2016-03-31 Thread Christian Couder
On Fri, Apr 1, 2016 at 12:56 AM, Junio C Hamano wrote: > Christian Couder writes: > >> On Wed, Mar 16, 2016 at 3:35 PM, Christian Couder >> wrote: >>> When parse_chunk() fails it can return -1, for example >>> when find_header() doesn't find a patch header. >>> >>> In this case it's better in ap

Re: [PATCH] builtin/apply: free patch when parse_chunk() fails

2016-03-31 Thread Junio C Hamano
Christian Couder writes: > On Wed, Mar 16, 2016 at 3:35 PM, Christian Couder > wrote: >> When parse_chunk() fails it can return -1, for example >> when find_header() doesn't find a patch header. >> >> In this case it's better in apply_patch() to free the >> "struct patch" that we just allocated

Re: [PATCH] builtin/apply: free patch when parse_chunk() fails

2016-03-31 Thread Christian Couder
On Wed, Mar 16, 2016 at 3:35 PM, Christian Couder wrote: > When parse_chunk() fails it can return -1, for example > when find_header() doesn't find a patch header. > > In this case it's better in apply_patch() to free the > "struct patch" that we just allocated instead of > leaking it. Maybe this

[PATCH] builtin/apply: free patch when parse_chunk() fails

2016-03-19 Thread Christian Couder
When parse_chunk() fails it can return -1, for example when find_header() doesn't find a patch header. In this case it's better in apply_patch() to free the "struct patch" that we just allocated instead of leaking it. Signed-off-by: Christian Couder --- builtin/apply.c | 4 +++- 1 file changed,