Commit 7b48faec authored by Tollef Fog Heen's avatar Tollef Fog Heen Committed by Tollef Fog Heen

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

parent 597f4e90
...@@ -378,7 +378,6 @@ i_mode(void) ...@@ -378,7 +378,6 @@ i_mode(void)
} }
AN(topbuild); AN(topbuild);
extmacro_def("topbuild", "%s", topbuild); extmacro_def("topbuild", "%s", topbuild);
free(topbuild);
/* /*
* Build $PATH which can find all programs in the build tree * Build $PATH which can find all programs in the build tree
*/ */
...@@ -411,6 +410,7 @@ i_mode(void) ...@@ -411,6 +410,7 @@ i_mode(void)
} while (0); } while (0);
#include "vmods.h" #include "vmods.h"
#undef VTC_VMOD #undef VTC_VMOD
free(topbuild);
VSB_delete(vsb); VSB_delete(vsb);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment