git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] Fix memory leaks in read_tree_recursive()

From
Junio C Hamano <junkio@cox.net>
Date
May 4, 2005, 23:43 UTC
Message-ID
<7vpsw6muay.fsf@assigned-by-dhcp.cox.net>
In-Reply-To
<20050504231959.GA25475@diku.dk>
>>>>> "JF" == Jonas Fonseca <fonseca@diku.dk> writes:

JF> This patch fixes memory leaks in the error path of JF> read_tree_recursive().

The leak seems to be real but what is "mem_free"? Has it been compile tested?

JF> @@ -39,14 +39,18 @@
JF>  		if (S_ISDIR(mode)) {
JF>  			int retval;
 
JF> ...
JF> -			if (!eltbuf || strcmp(elttype, "tree"))
JF> +			if (!eltbuf || strcmp(elttype, "tree")) {
JF> +				if (eltbuf) mem_free(eltbuf);
JF>  				return -1;

Btw, who is putting this header in your mail? It does not make sense to me unless Jonas is pseudonym for Linus...

  Mail-Followup-To: Linus Torvalds <torvalds@osdl.org>, git@vger.kernel.org 
Previous: Jonas FonsecaNext: Jonas Fonseca
Message 3 of 4 in “Fix memory leaks in read_tree_recursive()”
  1. Fix memory leaks in read_tree_recursive()Jonas Fonseca, May 4, 2005
  2. Fix memory leaks in read_tree_recursive()Jonas Fonseca, May 4, 2005
  3. Junio C HamanoMay 4, 2005
  4. Jonas FonsecaMay 5, 2005

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.