Files
git/builtin
Karsten Blees 5699d17ee0 read-cache.c: fix memory leaks caused by removed cache entries
When cache_entry structs are removed from index_state.cache, they are not
properly freed. Freeing those entries wasn't possible before because we
couldn't remove them from index_state.name_hash.

Now that we _do_ remove the entries from name_hash, we can also free them.
Add 'free(cache_entry)' to all call sites of name-hash.c::remove_name_hash
in read-cache.c (we could free() directly in remove_name_hash(), but
name-hash.c isn't concerned with cache_entry allocation at all).

Accessing a cache_entry after removing it from the index is now no longer
allowed, as the memory has been freed. The following functions need minor
fixes (typically by copying ce->name before use):
 - builtin/rm.c::cmd_rm
 - builtin/update-index.c::do_reupdate
 - read-cache.c::read_index_unmerged
 - resolve-undo.c::unmerge_index_entry_at

Signed-off-by: Karsten Blees <blees@dcon.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-11-18 13:04:25 -08:00
..
2013-09-17 11:42:34 -07:00
2013-09-09 14:36:15 -07:00
2013-09-09 14:50:44 -07:00
2013-09-09 14:36:15 -07:00
2013-10-15 16:15:00 -07:00
2013-09-17 11:42:31 -07:00
2013-09-09 14:30:29 -07:00
2013-09-20 12:36:12 -07:00
2013-09-17 11:37:33 -07:00
2013-09-09 14:36:15 -07:00
2013-09-09 14:36:15 -07:00
2013-09-09 14:36:15 -07:00
2013-09-17 11:42:51 -07:00
2013-09-09 14:36:15 -07:00
2013-09-11 14:56:59 -07:00
2013-09-20 12:36:12 -07:00
2013-07-15 10:56:07 -07:00
2013-09-20 12:36:12 -07:00