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

[PATCH v2 3/4] object.c: free replace map in raw_object_store_clear

From
Stefan Beller <sbeller@google.com>
Date
May 10, 2018, 19:58 UTC
Message-ID
<20180510195849.28023-4-sbeller@google.com>
In-Reply-To
<20180510195849.28023-1-sbeller@google.com>

The replace map for objects was missed to free in the object store in the conversion of c1274495 ("replace-object: eliminate replace objects prepared flag", 2018-04-11). We also missed to free the replaced objects that are put into the replace map in that whole series.

Signed-off-by: Stefan Beller <sbeller@google.com>
---
 object.c | 3 +++
 1 file changed, 3 insertions(+)
diff --git a/object.c b/object.c
index 242d922d953..80d1cae53c0 100644
--- a/object.c
+++ b/object.c
@@ -481,6 +481,9 @@ void raw_object_store_clear(struct raw_object_store *o)
 	FREE_AND_NULL(o->objectdir);
 	FREE_AND_NULL(o->alternate_db);
 
+	oidmap_free(o->replace_map, 1);
+	FREE_AND_NULL(o->replace_map);
+
 	free_alt_odbs(o);
 	o->alt_odb_tail = NULL;
 
-- 
2.17.0.255.g8bfb7c0704
Previous: Stefan BellerNext: Stefan Beller
Message 4 of 7 in “Fix mem leaks of recent object store conversions.”
  1. 0/4 Fix mem leaks of recent object store conversions.Stefan Beller, May 10, 2018
  2. 1/4 packfile: close and free packs upon releasing an object storeStefan Beller, May 10, 2018
  3. 2/4 packfile.h: remove all extern keywordsStefan Beller, May 10, 2018
  4. 3/4 object.c: free replace map in raw_object_store_clearStefan Beller, May 10, 2018
  5. 4/4 replace-object.c: remove the_repository from prepare_replace_objectStefan Beller, May 10, 2018
  6. Jeff KingMay 11, 2018
  7. Stefan BellerMay 11, 2018

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.