mirror of
https://github.com/git/git.git
synced 2026-03-13 18:33:25 +01:00
Fix mkstemp emulation to not free the template string.
The template argument was strduped unnecessarily and then not used, and the wrong string was freed.
This commit is contained in:
@@ -81,15 +81,10 @@ const char *inet_ntop(int af, const void *src,
|
||||
}
|
||||
int mkstemp (char *__template)
|
||||
{
|
||||
char *temp = xstrdup(__template);
|
||||
char *filename = mktemp(__template);
|
||||
int fd;
|
||||
|
||||
if (filename == NULL)
|
||||
return -1;
|
||||
fd = open(filename, O_RDWR | O_CREAT);
|
||||
free(filename);
|
||||
return fd;
|
||||
return open(filename, O_RDWR | O_CREAT);
|
||||
}
|
||||
int gettimeofday(struct timeval *tv, void *tz)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user