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

[PATCH] plug a DIR buffer leak in rerere.c

From
Jim Meyering <jim@meyering.net>
Date
May 26, 2011, 13:55 UTC
Message-ID
<8762ox7ehl.fsf@rho.meyering.net>
* rerere.c (rerere_gc): Don't leak a DIR buffer.
---
Spotted by coverity, and since I was already looking at this
particular file...
Like the preceding patch, this is relative to "next".
 rerere.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/rerere.c b/rerere.c
index cb8e5ba..dcb525a 100644
--- a/rerere.c
+++ b/rerere.c
@@ -745,6 +745,7 @@ void rerere_gc(struct string_list *rr)
 		if (then < now - cutoff * 86400)
 			string_list_append(&to_remove, e->d_name);
 	}
+	closedir(dir);
 	for (i = 0; i < to_remove.nr; i++)
 		unlink_rr_item(to_remove.items[i].string);
 	string_list_clear(&to_remove, 0);
--
1.7.5.2.660.g9f46c
Next: Junio C Hamano
Message 1 of 3 in “plug a DIR buffer leak in rerere.c”
  1. plug a DIR buffer leak in rerere.cJim Meyering, May 26, 2011
  2. Junio C HamanoMay 26, 2011
  3. Jim MeyeringMay 26, 2011

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.