Merge branch 'jk/test-mktemp-leakfix'
Test leakfix. * jk/test-mktemp-leakfix: test-mktemp: plug memory and descriptor leaksmain
commit
24ddb3f1fc
|
|
@ -6,10 +6,16 @@
|
||||||
|
|
||||||
int cmd__mktemp(int argc, const char **argv)
|
int cmd__mktemp(int argc, const char **argv)
|
||||||
{
|
{
|
||||||
|
char *template;
|
||||||
|
int fd;
|
||||||
|
|
||||||
if (argc != 2)
|
if (argc != 2)
|
||||||
usage("Expected 1 parameter defining the temporary file template");
|
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;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue