summaryrefslogtreecommitdiff
path: root/graphics/asymptote/runfile.in
diff options
context:
space:
mode:
Diffstat (limited to 'graphics/asymptote/runfile.in')
-rw-r--r--graphics/asymptote/runfile.in8
1 files changed, 5 insertions, 3 deletions
diff --git a/graphics/asymptote/runfile.in b/graphics/asymptote/runfile.in
index d9186eee6d..39eb464c28 100644
--- a/graphics/asymptote/runfile.in
+++ b/graphics/asymptote/runfile.in
@@ -348,15 +348,17 @@ Int rename(string from, string to)
return rc;
}
-// Create a unique temporary file name.
+// Create a uniquely named temporary file.
string mktemp(string s)
{
- char *S=Strdup(s+"XXXXXX");
+ char *S=StrdupMalloc(s+"XXXXXX");
int fd=mkstemp(S);
if(fd < 0) {
ostringstream buf;
buf << "Could not create unique temporary filename based on " << s;
error(buf);
}
- return S;
+ string T(S);
+ free(S);
+ return T;
}