Merge branch 'jk/test-mktemp-leakfix'

Test leakfix.

* jk/test-mktemp-leakfix:
  test-mktemp: plug memory and descriptor leaks
This commit is contained in:
Junio C Hamano
2025-11-26 10:32:41 -08:00

View File

@@ -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;
}