Git development
 help / color / mirror / Atom feed
* [PATCH] Fix memory leak in prepend_to_path (git.c).
@ 2006-09-05  6:22 Christian Couder
  0 siblings, 0 replies; only message in thread
From: Christian Couder @ 2006-09-05  6:22 UTC (permalink / raw)
  To: Junio Hamano; +Cc: git

Some memory was allocated for a new path but not freed
after the path was used.

Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
---
 git.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/git.c b/git.c
index 1d00111..335f405 100644
--- a/git.c
+++ b/git.c
@@ -36,6 +36,8 @@ static void prepend_to_path(const char *
 	memcpy(path + len + 1, old_path, path_len - len);
 
 	setenv("PATH", path, 1);
+
+	free(path);
 }
 
 static int handle_options(const char*** argv, int* argc)
-- 
1.4.2.g269a-dirty

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2006-09-05  6:17 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-09-05  6:22 [PATCH] Fix memory leak in prepend_to_path (git.c) Christian Couder

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox