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

[PATCH v2 4/7] http-walker: cleanup more thoroughly

From
Tay Ray Chuan <rctay89@gmail.com>
Date
Mar 2, 2010, 10:49 UTC
Message-ID
<1267526971-5552-5-git-send-email-rctay89@gmail.com>
In-Reply-To
<1267526971-5552-1-git-send-email-rctay89@gmail.com>
Signed-off-by: Tay Ray Chuan <rctay89@gmail.com>
---
 http-walker.c |   17 +++++++++++++++++
 1 files changed, 17 insertions(+), 0 deletions(-)
diff --git a/http-walker.c b/http-walker.c
index 700bc13..508e355 100644
--- a/http-walker.c
+++ b/http-walker.c
@@ -543,6 +543,23 @@ static int fetch_ref(struct walker *walker, struct ref *ref)
 
 static void cleanup(struct walker *walker)
 {
+	struct walker_data *data = walker->data;
+	struct alt_base *alt, *alt_next;
+
+	if (data) {
+		alt = data->alt;
+		while (alt) {
+			alt_next = alt->next;
+
+			free(alt->base);
+			free(alt);
+
+			alt = alt_next;
+		}
+		free(data);
+		walker->data = NULL;
+	}
+
 	http_cleanup();
 }
 
-- 
1.7.0.26.gbfa16
Previous: Tay Ray ChuanNext: Tay Ray Chuan
Message 5 of 9 in “http: minor improvements”
  1. 0/7 http: minor improvementsTay Ray Chuan, Mar 2, 2010
  2. 1/7 t5541-http-push: check that ref is unchanged for non-ff testTay Ray Chuan, Mar 2, 2010
  3. 2/7 t554[01]-http-push: refactor, add non-ff testsTay Ray Chuan, Mar 2, 2010
  4. 3/7 http-push: remove "|| 1" to enable verbose checkTay Ray Chuan, Mar 2, 2010
  5. 4/7 http-walker: cleanup more thoroughlyTay Ray Chuan, Mar 2, 2010
  6. 5/7 http: init and cleanup separately from http-walkerTay Ray Chuan, Mar 2, 2010
  7. 6/7 remote-curl: use http_fetch_ref() instead of walker wrapperTay Ray Chuan, Mar 2, 2010
  8. 7/7 remote-curl: init walker only when neededTay Ray Chuan, Mar 2, 2010
  9. Clemens BuchacherMar 4, 2010

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.