Thread (1 message) 1 message, 1 author, 2016-06-15

Re: [PATCH] add receive.denyNonFastforwards config variable

From: Junio C Hamano <hidden>
Date: 2016-06-15 22:42:41

Johannes Schindelin [off-list ref] writes:
On Wed, 20 Sep 2006, Jeff King wrote:
quoted
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.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help