dtexec,DtSvc/MsgLog.c: coverity CID 89585; resource leak

This commit is contained in:
Jon Trulson 2018-04-01 13:54:22 -06:00
parent adb0acbaf5
commit 5729327cc8
1 changed files with 7 additions and 6 deletions

View File

@ -141,7 +141,7 @@ static char * get_file_name (
const char * format,
... )
{
char *file, *rtn;
char *file;
va_list args;
file = malloc(MAXPATHLEN+1);
@ -153,11 +153,12 @@ static char * get_file_name (
va_end (args);
if ((*fp = fopen (file, type)) == NULL)
return (NULL);
rtn = strdup (file);
free(file);
return rtn;
{
free(file);
return (NULL);
}
return file;
}