threads / patch / 27465

patchplug a DIR buffer leak in rerere.c

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

## tl;dr

3 messages between May 26, 2011 and May 26, 2011. Diffs are folded; open one to read it.

replies: 2people: 2as markdown or json

Jim Meyering· May 26, 2011, 13:55 UTC · lore
* 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(-)
Show changes to rerere.c +1 −1
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

← back to recent threads