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

[PATCH] small memory leak fix

From
DCDavid CARLIER <devnexen@gmail.com>
Date
May 1, 2017, 20:40 UTC
Message-ID
<C3A43A45-9120-4755-AE42-FD33F68F3FCB@gmail.com>
Hi this is my first submission, a memory leak found in the maint branch (might be in master as well).
Kind regards.
From d98f3944780730447f111a4178c9d99f5110c260 Mon Sep 17 00:00:00 2001
From: David Carlier <devnexen@gmail.com>
Date: Mon, 1 May 2017 21:14:09 +0100
Subject: [PATCH] memory leaks fixes for remote lists.

both push and fetch lists were not freed thus using free_refspecs usage.

Signed-off-by: David Carlier <devnexen@gmail.com>
---
 remote.c | 2 ++
 1 file changed, 2 insertions(+)
diff --git a/remote.c b/remote.c
index 9f83fe2c4..2f8cb35a3 100644
--- a/remote.c
+++ b/remote.c
@@ -742,6 +742,8 @@ int for_each_remote(each_remote_fn fn, void *priv)
 			r->push = parse_push_refspec(r->push_refspec_nr,
 						     r->push_refspec);
 		result = fn(r, priv);
+		free_refspecs(r->push, r->push_refspec_nr);
+		free_refspecs(r->fetch, r->fetch_refspec_nr);
 	}
 	return result;
 }
-- 
2.12.2
Next: Stefan Beller
Message 1 of 3 in “small memory leak fix”
  1. small memory leak fixDavid CARLIER, May 1, 2017
  2. Stefan BellerMay 1, 2017
  3. Jeff KingMay 1, 2017

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.