[master] 74dd224 No need to strdup the default varnishncsa format

Dridi Boukelmoune dridi.boukelmoune at gmail.com
Mon May 15 23:22:05 CEST 2017


commit 74dd2249f4181869d74b0260e3b7c8fb231accbe
Author: Dridi Boukelmoune <dridi.boukelmoune at gmail.com>
Date:   Mon May 15 23:20:43 2017 +0200

    No need to strdup the default varnishncsa format

diff --git a/bin/varnishncsa/varnishncsa.c b/bin/varnishncsa/varnishncsa.c
index dc64f4b..04efbda 100644
--- a/bin/varnishncsa/varnishncsa.c
+++ b/bin/varnishncsa/varnishncsa.c
@@ -678,6 +678,9 @@ parse_format(const char *format)
 	struct vsb *vsb;
 	char buf[256];
 
+	if (format == NULL)
+		format = FORMAT;
+
 	vsb = VSB_new_auto();
 	AN(vsb);
 
@@ -1212,8 +1215,6 @@ main(int argc, char * const *argv)
 		    VSLQ_grouping[VUT.g_arg]);
 
 	/* Prepare output format */
-	if (format == NULL)
-		format = strdup(FORMAT);
 	parse_format(format);
 	free(format);
 	format = NULL;



More information about the varnish-commit mailing list