Skip to contentSkip to conversation

plug a DIR buffer leak in rerere.c

PATCH In review Jim Meyering 2 participants 3 messages Jun 15, 2016

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 plug a DIR buffer leak in rerere.c

* 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(-)
rerere.c +1 -0
index cb8e5ba..dcb525a 100644
@@ -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

#2 lore raw
Quoted 1 line · Junio C Hamano

Thanks; I assume both of these are signed-off?

Yes. Sorry about the omission.