From: Junio C Hamano Date: Thu, 21 Sep 2006 05:35:13 GMT Subject: Re: [PATCH] add receive.denyNonFastforwards config variable Message-ID: <7vzmctdbou.fsf@assigned-by-dhcp.cox.net> In-Reply-To: Johannes Schindelin writes: > 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.