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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



* 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
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]