The filename of the created tempfile is returned in the name parameter.
After closing the file we can reuse the name without a race.
http://linux.die.net/man/3/mkstemp
I don't see any security issue here at all because the linker simply writes to the file.