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

[PATCH] update-cache --refresh cache entry leak

From
Junio C Hamano <junkio@cox.net>
Date
Apr 16, 2005, 22:51 UTC
Message-ID
<7v8y3i5o8t.fsf@assigned-by-dhcp.cox.net>

When update-cache --refresh replaces an existing cache entry with a new one, it forgets to free the original.

Signed-off-by: Junio C Hamano <junkio@cox.net>
---
update-cache.c:  61d2b93a751f35ba24f479cd4fc151188916f02a
--- update-cache.c
+++ update-cache.c	2005-04-16 15:49:03.000000000 -0700
@@ -203,6 +203,8 @@
 			printf("%s: needs update\n", ce->name);
 			continue;
 		}
+		if (new != ce)
+			free(ce);
 		active_cache[i] = new;
 	}
 }
Next: Linus Torvalds
Message 1 of 3 in “update-cache --refresh cache entry leak”
  1. update-cache --refresh cache entry leakJunio C Hamano, Apr 16, 2005
  2. Linus TorvaldsApr 17, 2005
  3. Junio C HamanoApr 17, 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.