Mailing List Archive

[master] ad0279a49 Fix insignificant memory leak spotted by Coverity
commit ad0279a494f0efb4c47e697053a374bb662c79dd
Author: Poul-Henning Kamp <phk@FreeBSD.org>
Date: Mon Mar 13 08:41:34 2023 +0000

Fix insignificant memory leak spotted by Coverity

diff --git a/bin/varnishd/mgt/mgt_main.c b/bin/varnishd/mgt/mgt_main.c
index 698a6bbe6..c1bdaf812 100644
--- a/bin/varnishd/mgt/mgt_main.c
+++ b/bin/varnishd/mgt/mgt_main.c
@@ -82,9 +82,10 @@ static const char opt_spec[] = "?a:b:CdE:f:Fh:i:I:j:l:M:n:P:p:r:S:s:T:t:VW:x:";
static void
usage(void)
{
- char buf[1024];
+ char *p;

-#define FMT " %-28s # %s\n"
+#define FMT_NONL " %-28s # %s"
+#define FMT FMT_NONL "\n"

printf( "Usage: varnishd [options]\n");

@@ -104,8 +105,12 @@ usage(void)
printf(FMT, "", " default: \":80\"");
printf(FMT, "-f vclfile", "VCL program");
printf(FMT, "", "Can be specified multiple times.");
- bprintf(buf, "Working directory (default: %s)", VIN_n_Arg(NULL));
- printf(FMT, "-n dir", buf);
+ printf(FMT, "-n dir", "Working directory");
+
+ p = VIN_n_Arg(NULL);
+ AN(p);
+ printf(FMT_NONL " default: %s\n", "", "", p);
+ free(p);

printf("\n-b can be used only once, and not together with -f\n");

_______________________________________________
varnish-commit mailing list
varnish-commit@varnish-cache.org
https://www.varnish-cache.org/lists/mailman/listinfo/varnish-commit