提交 04f20c04 编写于 作者: S Stefan Beller 提交者: Junio C Hamano

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: NStefan Beller <sbeller@google.com>
Signed-off-by: NJunio C Hamano <gitster@pobox.com>
上级 7a9409cb
......@@ -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");
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册