Fix memory leak in prepend_to_path (git.c).
Some memory was allocated for a new path but not freed after the path was used. Signed-off-by: Christian Couder <chriscool@tuxfamily.org> Signed-off-by: Junio C Hamano <junkio@cox.net>
Christian Couder committed
Sep 5, 2006 at 08:22 UTC
0caea90be0e565a923b69df7b32c13cbcf892d6d
1 file changed
+2
git.c
+2
@@ -36,6 +36,8 @@ static void prepend_to_path(const char *dir, int len)
36
memcpy(path + len + 1, old_path, path_len - len);
37
38
setenv("PATH", path, 1);
39
+
40
+ free(path);
41
}
42
43
static int handle_options(const char*** argv, int* argc)