[PATCH] Fix minor memory leak in init-db

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

 



There was an xmalloc() for path, but I didn't see a corresponding free().
Does it happen somewhere else that I'm not expecting?

Signed-off-by: Ammon Riley <ammon.riley@xxxxxxxxx>
---
 builtin-init-db.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/builtin-init-db.c b/builtin-init-db.c
index d1fa12a..6969987 100644
--- a/builtin-init-db.c
+++ b/builtin-init-db.c
@@ -308,6 +308,8 @@ int init_db(const char *template_dir, unsigned int flags)
 	strcpy(path+len, "/info");
 	safe_create_dir(path, 1);

+	free(path);
+
 	if (shared_repository) {
 		char buf[10];
 		/* We do not spell "group" and such, so that
-- 
1.6.3.1.9.g95405b.dirty
--
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]