From 04f20c04c6e51ee061a44406b9a73bf54683d8eb Mon Sep 17 00:00:00 2001 From: Stefan Beller Date: Mon, 9 Mar 2015 09:58:22 -0700 Subject: 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 Signed-off-by: Junio C Hamano --- connect.c | 1 + 1 file changed, 1 insertion(+) diff --git a/connect.c b/connect.c index ce0e121423..6090211fe9 100644 --- a/connect.c +++ b/connect.c @@ -739,6 +739,7 @@ struct child_process *git_connect(int fd[2], const char *url, free(hostandport); free(path); + free(conn); return NULL; } else { ssh = getenv("GIT_SSH_COMMAND"); -- cgit v1.2.3