]> git.ipfire.org Git - thirdparty/git.git/commitdiff
http-push: clear refspecs before exiting
authorJeff King <peff@peff.net>
Tue, 24 Sep 2024 22:04:30 +0000 (18:04 -0400)
committerJunio C Hamano <gitster@pobox.com>
Wed, 25 Sep 2024 17:24:56 +0000 (10:24 -0700)
We parse the command-line arguments into a refspec struct, but we never
free them. We should do so before exiting to avoid triggering the
leak-checker.

This triggers in t5540 many times (basically every invocation of
http-push).

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

index 7196ffa52570a9f185732f07aa8e4471122444d1..f60b2ceba579ca3026ffcf63b54c9cdb3b654d5f 100644 (file)
@@ -1983,5 +1983,7 @@ int cmd_main(int argc, const char **argv)
                request = next_request;
        }
 
+       refspec_clear(&rs);
+
        return rc;
 }