diff --git a/libs/libc/stdio/lib_tmpfile.c b/libs/libc/stdio/lib_tmpfile.c index 519f159c69..5c27de8927 100644 --- a/libs/libc/stdio/lib_tmpfile.c +++ b/libs/libc/stdio/lib_tmpfile.c @@ -39,7 +39,7 @@ FAR FILE *tmpfile(void) fd = mkstemp(path); if (fd >= 0) { - unlink(fd); + unlink(path); fp = fdopen(fd, "w+"); if (fp == NULL) {