Skip to content

Commit

Permalink
Fix memory leak in prepend_to_path (git.c).
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Christian Couder authored and Junio C Hamano committed Sep 6, 2006
1 parent c41e20b commit 0caea90
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions git.c
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ static void prepend_to_path(const char *dir, int len)
memcpy(path + len + 1, old_path, path_len - len);

setenv("PATH", path, 1);

free(path);
}

static int handle_options(const char*** argv, int* argc)
Expand Down

0 comments on commit 0caea90

Please sign in to comment.