Re: [PATCH] add receive.denyNonFastforwards config variable
Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:
Show 19 quoted lines
> On Wed, 20 Sep 2006, Jeff King wrote:
>
>> Memory leak on 'bases'. It shouldn't matter much because the program is
>> short-lived, but I couldn't remember if we have a policy on such things
>> with increasing lib-ification.
>
> True. How about this:
>
> -- snip --
>
> + backup = get_merge_bases(old_commit, new_commit, 1);
> + for (bases = backup;
> bases; bases = bases->next)
> if (!hashcmp(old_sha1, bases->item->object.sha1))
> break;
> if (!bases)
> return error("denying non-fast forward;"
> " you should pull first");
> + free_commit_list(backup);Still leaking on the error path ;-).
Will fixup and apply; no need to resend.