dtexec,DtSvc/MsgLog.c: coverity CID 89585; resource leak
authorJon Trulson <jon@radscan.com>
Sun, 1 Apr 2018 19:54:22 +0000 (13:54 -0600)
committerJon Trulson <jon@radscan.com>
Sun, 1 Apr 2018 19:54:22 +0000 (13:54 -0600)
cde/lib/DtSvc/DtUtil2/MsgLog.c

index 0aa48d1d5ec43928bb63e93d1015d5bf27aa612e..8997b74566aa5f6beb7947e5e6ba0900adfe9aa7 100644 (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;
 }