Skip to content

Commit

Permalink
Remove temporary directory iff called with -C
Browse files Browse the repository at this point in the history
Fixes #1869
  • Loading branch information
fgsch committed Mar 14, 2016
1 parent 59ae9c2 commit 8686a49
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions bin/varnishd/mgt/mgt_vcc.c
Original file line number Diff line number Diff line change
Expand Up @@ -296,18 +296,21 @@ mgt_VccCompile(struct cli *cli, const char *vclname, const char *vclsrc,
(void)unlink(vp.csrcfile);
free(vp.csrcfile);

free(vp.dir);

if (status || C_flag) {
(void)unlink(vp.libfile);
free(vp.libfile);
if (C_flag)
AZ(rmdir(vp.dir));
free(vp.dir);
if (status) {
VCLI_Out(cli, "VCL compilation failed");
VCLI_SetResult(cli, CLIS_PARAM);
}
return(NULL);
}

free(vp.dir);

VCLI_Out(cli, "VCL compiled.\n");

return (vp.libfile);
Expand Down

0 comments on commit 8686a49

Please sign in to comment.