connect.c: do not leak "conn" after showing diagnosis
When git_connect() is called to see how the URL is parsed for debugging purposes with CONNECT_DIAG_URL set, the variable conn is leaked. At this point in the codeflow, it only has its memory and no other resource is associated with it, so it is sufficient to clean it up by just freeing it. Signed-off-by: Stefan Beller <sbeller@google.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Stefan Beller committed
Mar 9, 2015 at 09:58 UTC
04f20c04c6e51ee061a44406b9a73bf54683d8eb
1 file changed
+1
connect.c
+1
@@ -739,6 +739,7 @@ struct child_process *git_connect(int fd[2], const char *url,
739
740
free(hostandport);
741
free(path);
742
+ free(conn);
743
return NULL;
744
} else {
745
ssh = getenv("GIT_SSH_COMMAND");