]> git.ipfire.org Git - thirdparty/git.git/commitdiff
http-push: free repo->url string
authorJeff King <peff@peff.net>
Tue, 24 Sep 2024 22:04:46 +0000 (18:04 -0400)
committerJunio C Hamano <gitster@pobox.com>
Wed, 25 Sep 2024 17:24:56 +0000 (10:24 -0700)
Our repo->url string comes from str_end_url_with_slash(), which always
allocates its output buffer. We should free it before exiting to avoid
triggering the leak-checker.

This can be seen by leak-checking t5540.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
http-push.c

index f60b2ceba579ca3026ffcf63b54c9cdb3b654d5f..52c53928a90bcb161628d8c9056102b24ef5adbf 100644 (file)
@@ -1972,6 +1972,7 @@ int cmd_main(int argc, const char **argv)
  cleanup:
        if (info_ref_lock)
                unlock_remote(info_ref_lock);
+       free(repo->url);
        free(repo);
 
        http_cleanup();