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

[PATCH 2/6] shallow: fix a memleak

From
Stefan Beller <sbeller@google.com>
Date
Mar 27, 2015, 22:09 UTC
Message-ID
<1427494150-8085-5-git-send-email-sbeller@google.com>
In-Reply-To
<1427494150-8085-1-git-send-email-sbeller@google.com>
Signed-off-by: Stefan Beller <sbeller@google.com>
---
 shallow.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/shallow.c b/shallow.c
index d8bf40a..f8b0458 100644
--- a/shallow.c
+++ b/shallow.c
@@ -416,7 +416,7 @@ static void paint_down(struct paint_info *info, const unsigned char *sha1,
 	uint32_t *bitmap = paint_alloc(info);
 	struct commit *c = lookup_commit_reference_gently(sha1, 1);
 	if (!c)
-		return;
+		goto out;
 	memset(bitmap, 0, bitmap_size);
 	bitmap[id / 32] |= (1 << (id % 32));
 	commit_list_insert(c, &head);
@@ -471,7 +471,7 @@ static void paint_down(struct paint_info *info, const unsigned char *sha1,
 		if (o && o->type == OBJ_COMMIT)
 			o->flags &= ~SEEN;
 	}
-
+out:
 	free(tmp);
 }
 
-- 
2.3.0.81.gc37f363
Previous: Stefan BellerNext: Stefan Beller
Message 5 of 12 in “Memory leaks once again”
  1. 0/6 Memory leaks once againStefan Beller, Mar 27, 2015
  2. 1/6 pack-bitmap: fix a memleakStefan Beller, Mar 27, 2015
  3. 1/6 shallow: fix a memleakStefan Beller, Mar 27, 2015
  4. 2/6 line-log.c: fix a memleakStefan Beller, Mar 27, 2015
  5. 2/6 shallow: fix a memleakStefan Beller, Mar 27, 2015
  6. 3/6 line-log.c: fix a memleakStefan Beller, Mar 27, 2015
  7. 4/6 line-log.c: fix a memleakStefan Beller, Mar 27, 2015
  8. 4/6 wt-status.c: fix a memleakStefan Beller, Mar 27, 2015
  9. 5/6 pack-bitmap: fix a memleakStefan Beller, Mar 27, 2015
  10. 5/6 wt-status.c: fix a memleakStefan Beller, Mar 27, 2015
  11. 6/6 WIP/RFC/entry.c: fix a memleakStefan Beller, Mar 27, 2015
  12. Stefan BellerMar 27, 2015

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.