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

[PATCH] fixup! read-cache.c: fix memory leaks caused by removed cache, entries

From
Karsten Blees <karsten.blees@gmail.com>
Date
Oct 22, 2013, 13:13 UTC
Message-ID
<526679ED.7060105@gmail.com>
In-Reply-To
<8738nx2h70.fsf@thomasrast.ch>
...another instance where we access a free()d ce.
Signed-off-by: Karsten Blees <blees@dcon.de>
---
Am 19.10.2013 21:28, schrieb Thomas Rast:
> 
> Is this the version that is currently in pu?
No, its from a rebased-to-next version [1]. I didn't resend the patches because nothing actually changed (except diff contexts). Sorry for the inconvenience.
Show 7 quoted lines
> In any case 36850edb currently breaks several valgrind tests.  You can
> valgrind only t6022.16 like so (that one test is sufficient to track it
> down and it's much faster that way):
> 
>   cd t  
>   ./t6022-merge-rename.sh --valgrind-only=16
> 
Thanks, here's the fix.
Karsten
[1] https://github.com/kblees/git/commits/kb/hashmap-v3-next
 read-cache.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/read-cache.c b/read-cache.c
index fe90c3b..3f735f3 100644
--- a/read-cache.c
+++ b/read-cache.c
@@ -1898,7 +1898,7 @@ int read_index_unmerged(struct index_state *istate)
 		new_ce->ce_mode = ce->ce_mode;
 		if (add_index_entry(istate, new_ce, 0))
 			return error("%s: cannot drop to stage #0",
-				     ce->name);
+				     new_ce->name);
 		i = index_name_pos(istate, new_ce->name, len);
 	}
 	return unmerged;
-- 
1.8.4.msysgit.0.12.g88f5ed0.dirty
Previous: Thomas RastNext: Karsten Blees
Message 13 of 14 in “New hash table implementation”
  1. 00/11 New hash table implementationKarsten Blees, Oct 1, 2013
  2. 01/11 add a hashtable implementation that supports O(1) removalKarsten Blees, Oct 1, 2013
  3. 02/11 buitin/describe.c: use new hash map implementationKarsten Blees, Oct 1, 2013
  4. 03/11 diffcore-rename.c: move code around to prepare for the next patchKarsten Blees, Oct 1, 2013
  5. 04/11 diffcore-rename.c: simplify finding exact renamesKarsten Blees, Oct 1, 2013
  6. 05/11 diffcore-rename.c: use new hash map implementationKarsten Blees, Oct 1, 2013
  7. 06/11 name-hash.c: use new hash map implementation for directoriesKarsten Blees, Oct 1, 2013
  8. 07/11 name-hash.c: remove unreferenced directory entriesKarsten Blees, Oct 1, 2013
  9. 08/11 name-hash.c: use new hash map implementation for cache entriesKarsten Blees, Oct 1, 2013
  10. 09/11 name-hash.c: remove cache entries instead of marking them CE_UNHASHEDKarsten Blees, Oct 1, 2013
  11. 10/11 read-cache.c: fix memory leaks caused by removed cache entriesKarsten Blees, Oct 1, 2013
  12. Thomas RastOct 19, 2013
  13. fixup! read-cache.c: fix memory leaks caused by removed cache, entriesKarsten Blees, Oct 22, 2013
  14. 11/11 remove old hash.[ch] implementationKarsten Blees, Oct 1, 2013

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.