All of lore.kernel.org
 help / color / mirror / Atom feed
From: Karsten Blees <karsten.blees@gmail.com>
To: Thomas Rast <tr@thomasrast.ch>
Cc: Git List <git@vger.kernel.org>, Junio C Hamano <gitster@pobox.com>
Subject: [PATCH] fixup! read-cache.c: fix memory leaks caused by removed cache, entries
Date: Tue, 22 Oct 2013 15:13:17 +0200	[thread overview]
Message-ID: <526679ED.7060105@gmail.com> (raw)
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.

> 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

  reply	other threads:[~2013-10-22 13:13 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-10-01  9:33 [PATCH v3 00/11] New hash table implementation Karsten Blees
2013-10-01  9:34 ` [PATCH v3 01/11] add a hashtable implementation that supports O(1) removal Karsten Blees
2013-10-01  9:35 ` [PATCH v3 02/11] buitin/describe.c: use new hash map implementation Karsten Blees
2013-10-01  9:36 ` [PATCH v3 03/11] diffcore-rename.c: move code around to prepare for the next patch Karsten Blees
2013-10-01  9:36 ` [PATCH v3 04/11] diffcore-rename.c: simplify finding exact renames Karsten Blees
2013-10-01  9:37 ` [PATCH v3 05/11] diffcore-rename.c: use new hash map implementation Karsten Blees
2013-10-01  9:37 ` [PATCH v3 06/11] name-hash.c: use new hash map implementation for directories Karsten Blees
2013-10-01  9:38 ` [PATCH v3 07/11] name-hash.c: remove unreferenced directory entries Karsten Blees
2013-10-01  9:39 ` [PATCH v3 08/11] name-hash.c: use new hash map implementation for cache entries Karsten Blees
2013-10-01  9:39 ` [PATCH v3 09/11] name-hash.c: remove cache entries instead of marking them CE_UNHASHED Karsten Blees
2013-10-01  9:40 ` [PATCH v3 10/11] read-cache.c: fix memory leaks caused by removed cache entries Karsten Blees
2013-10-19 19:28   ` Thomas Rast
2013-10-22 13:13     ` Karsten Blees [this message]
2013-10-01  9:40 ` [PATCH v3 11/11] remove old hash.[ch] implementation Karsten Blees

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=526679ED.7060105@gmail.com \
    --to=karsten.blees@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=tr@thomasrast.ch \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.