diff --git a/t/helper/test-mktemp.c b/t/helper/test-mktemp.c index 2290688940..da195640a9 100644 --- a/t/helper/test-mktemp.c +++ b/t/helper/test-mktemp.c @@ -6,10 +6,16 @@ int cmd__mktemp(int argc, const char **argv) { + char *template; + int fd; + if (argc != 2) usage("Expected 1 parameter defining the temporary file template"); + template = xstrdup(argv[1]); - xmkstemp(xstrdup(argv[1])); + fd = xmkstemp(template); + close(fd); + free(template); return 0; }