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>maint
parent
c41e20b30b
commit
0caea90be0
2
git.c
2
git.c
|
@ -36,6 +36,8 @@ static void prepend_to_path(const char *dir, int len)
|
||||||
memcpy(path + len + 1, old_path, path_len - len);
|
memcpy(path + len + 1, old_path, path_len - len);
|
||||||
|
|
||||||
setenv("PATH", path, 1);
|
setenv("PATH", path, 1);
|
||||||
|
|
||||||
|
free(path);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int handle_options(const char*** argv, int* argc)
|
static int handle_options(const char*** argv, int* argc)
|
||||||
|
|
Loading…
Reference in New Issue