* bucomm.c (make_tempname): Stop memory leak.

ICVS: ----------------------------------------------------------------------
This commit is contained in:
Nick Clifton 2011-03-25 17:51:10 +00:00
parent 4b41844bd9
commit c48d800e15
2 changed files with 5 additions and 1 deletions

View file

@ -511,7 +511,10 @@ make_tempname (char *filename)
fd = open (tmpname, O_RDWR | O_CREAT | O_EXCL, 0600);
#endif
if (fd == -1)
return NULL;
{
free (tmpname);
return NULL;
}
close (fd);
return tmpname;
}