[master] aee154f68 VUT_Init(): Allocate vut object only when not exiting

Nils Goroll nils.goroll at uplex.de
Mon Apr 26 12:09:05 UTC 2021


commit aee154f6846b5a2fbce9c078797e19f3865c1f93
Author: Nils Goroll <nils.goroll at uplex.de>
Date:   Mon Apr 26 14:07:24 2021 +0200

    VUT_Init(): Allocate vut object only when not exiting
    
    Closes #3597

diff --git a/lib/libvarnishapi/vut.c b/lib/libvarnishapi/vut.c
index 3c458f031..82077270a 100644
--- a/lib/libvarnishapi/vut.c
+++ b/lib/libvarnishapi/vut.c
@@ -246,9 +246,6 @@ VUT_Init(const char *progname, int argc, char * const *argv,
 	VSIG_Arm_term();
 	VSIG_Arm_usr1();
 
-	ALLOC_OBJ(vut, VUT_MAGIC);
-	AN(vut);
-
 	if (argc == 2 && !strcmp(argv[1], "--synopsis"))
 		exit(vut_synopsis(voc));
 	if (argc == 2 && !strcmp(argv[1], "--options"))
@@ -258,6 +255,8 @@ VUT_Init(const char *progname, int argc, char * const *argv,
 		exit(0);
 	}
 
+	ALLOC_OBJ(vut, VUT_MAGIC);
+	AN(vut);
 	vut->progname = progname;
 	vut->g_arg = VSL_g_vxid;
 	vut->k_arg = -1;


More information about the varnish-commit mailing list