Commit 81c7a6e7 authored by Tollef Fog Heen's avatar Tollef Fog Heen

Unlink -s file with autogenerated names

If just -s file or -s file,/path/to/directory is given, the file
stevedore will generate a name.  Make sure to unlink this to not leak
disk space over time.

Fixes: #1008
parent 21b7258b
......@@ -108,6 +108,7 @@ STV_GetFile(const char *fn, int *fdp, const char **fnp, const char *ctx)
if (fd < 0)
ARGV_ERR("(%s) \"%s\" mkstemp(%s) failed (%s)\n",
ctx, fn, buf, strerror(errno));
AZ(unlink(buf));
*fnp = strdup(buf);
AN(*fnp);
retval = 2;
......
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