On Mon, May 2, 2016 at 7:42 PM, Eric Sunshine <[email protected]> wrote:
> On Sun, Apr 24, 2016 at 9:34 AM, Christian Couder
> <[email protected]> wrote:
>> Signed-off-by: Christian Couder <[email protected]>
>> ---
>> diff --git a/builtin/apply.c b/builtin/apply.c
>> @@ -4381,7 +4387,7 @@ static int write_out_results(struct apply_state
>> *state, struct patch *list)
>> errs = 1;
>> else {
>> if (write_out_one_result(state, l, phase))
>> - exit(1);
>> + return -1;
>
> Isn't this leaking 'string_list cpath'?
Yes, it is. Will fix.
>> if (phase == 1) {
>> if (write_out_one_reject(state, l))
>> errs = 1;
>> @@ -4484,11 +4490,16 @@ static int apply_patch(struct apply_state *state,
>> !state->apply_with_reject)
>> return -1;
>>
>> - if (state->apply && write_out_results(state, list)) {
>> - if (state->apply_with_reject)
>> + if (state->apply) {
>> + int res = write_out_results(state, list);
>> + if (res < 0)
>> return -1;
>
> Mentioned previously: Leaking 'list', 'buf', 'fn_table'.
Yeah, already fixed.
>> - /* with --3way, we still need to write the index out */
>> - return 1;
>> + if (res > 0) {
>> + if (state->apply_with_reject)
>> + return -1;
>> + /* with --3way, we still need to write the index out
>> */
>> + return 1;
>
> Not the fault of this patch, but this 'return' in the original code
> was also leaking 'list', 'buf', 'fn_table', right?
Yeah, already fixed.
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html