diff options
| author | Jeff King <peff@peff.net> | 2024-09-24 17:51:24 -0400 |
|---|---|---|
| committer | Junio C Hamano <gitster@pobox.com> | 2024-09-25 10:24:53 -0700 |
| commit | 91aa67353971e994596e9cae77d6ec1d8feefa84 (patch) | |
| tree | c75b6d4ad60e2a6794eaec27edd5b8329203c81b /connect.c | |
| parent | 6f54d00439759feab82d40577d272c57d449a554 (diff) | |
| download | git-91aa67353971e994596e9cae77d6ec1d8feefa84.tar.gz | |
connect: clear child process before freeing in diagnostic mode
The git_connect() function has a special CONNECT_DIAG_URL mode, where we
stop short of actually connecting to the other side and just print some
parsing details. For URLs that require a child process (like ssh), we
free() the child_process struct but forget to clear it, leaking the
strings we stuffed into its "env" list.
This leak is triggered many times in t5500, which uses "fetch-pack
--diag-url", but we're not yet ready to mark it as leak-free.
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'connect.c')
| -rw-r--r-- | connect.c | 1 |
1 files changed, 1 insertions, 0 deletions
@@ -1485,6 +1485,7 @@ struct child_process *git_connect(int fd[2], const char *url, free(hostandport); free(path); + child_process_clear(conn); free(conn); strbuf_release(&cmd); return NULL; |
