{"thread":{"id":"5479","subject":"[PATCH] Fix memory leak in prepend_to_path (git.c).","startedAt":"2006-09-05T06:22:16Z","lastAt":"2006-09-05T06:22:16Z","messageCount":1,"participants":["Christian Couder"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"26344","messageId":"20060905082216.c9b11769.chriscool@tuxfamily.org","threadId":"5479","inReplyTo":null,"subject":"[PATCH] Fix memory leak in prepend_to_path (git.c).","fromName":"Christian Couder","fromEmail":"chriscool@tuxfamily.org","sentAt":"2006-09-05T06:22:16Z","receivedAt":"2006-09-05T06:22:16Z","isPatch":true,"sender":{"key":"christian.couder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/208954?v=4"},"body":"Some memory was allocated for a new path but not freed\nafter the path was used.\n\nSigned-off-by: Christian Couder <chriscool@tuxfamily.org>\n---\n git.c |    2 ++\n 1 files changed, 2 insertions(+), 0 deletions(-)\n\ndiff --git a/git.c b/git.c\nindex 1d00111..335f405 100644\n--- a/git.c\n+++ b/git.c\n@@ -36,6 +36,8 @@ static void prepend_to_path(const char *\n \tmemcpy(path + len + 1, old_path, path_len - len);\n \n \tsetenv(\"PATH\", path, 1);\n+\n+\tfree(path);\n }\n \n static int handle_options(const char*** argv, int* argc)\n-- \n1.4.2.g269a-dirty\n"}]}