http-push: clear refspecs before exiting

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>
maint
Jeff King 2024-09-24 18:04:30 -04:00 committed by Junio C Hamano
parent 134bfedf6d
commit 85430af347
1 changed files with 2 additions and 0 deletions

View File

@ -1983,5 +1983,7 @@ int cmd_main(int argc, const char **argv)
request = next_request;
}

refspec_clear(&rs);

return rc;
}