[master] 7b48fae Move freeing of topbuild later to prevent use-after-free

Tollef Fog Heen tfheen at err.no
Fri Mar 21 08:20:35 CET 2014


commit 7b48faecf3c71d1ed8f630878425f0e1f1d4db92
Author: Tollef Fog Heen <tfheen at fastly.com>
Date:   Fri Mar 21 08:12:25 2014 +0100

    Move freeing of topbuild later to prevent use-after-free

diff --git a/bin/varnishtest/vtc_main.c b/bin/varnishtest/vtc_main.c
index fc3b588..de08003 100644
--- a/bin/varnishtest/vtc_main.c
+++ b/bin/varnishtest/vtc_main.c
@@ -378,7 +378,6 @@ i_mode(void)
 	}
 	AN(topbuild);
 	extmacro_def("topbuild", "%s", topbuild);
-	free(topbuild);
 	/*
 	 * Build $PATH which can find all programs in the build tree
 	 */
@@ -411,6 +410,7 @@ i_mode(void)
 	} while (0);
 #include "vmods.h"
 #undef VTC_VMOD
+	free(topbuild);
 	VSB_delete(vsb);
 }
 



More information about the varnish-commit mailing list