dtsession/SrvFile_io: fix CID's 88299 and 89441
authorJon Trulson <jon@radscan.com>
Sun, 28 Dec 2014 03:06:53 +0000 (20:06 -0700)
committerJon Trulson <jon@radscan.com>
Sun, 28 Dec 2014 03:06:53 +0000 (20:06 -0700)
cde/programs/dtsession/SrvFile_io.c

index 237722bdebb23e56f54c2a6decc68482a600bfc4..1fa77e54092a0be2dd75687c08d73e63c0d9cc1f 100644 (file)
@@ -228,10 +228,8 @@ char    *palette)
                                                         DEFAULT_PALETTE);
     }
 
-    if (path != NULL)
-        SRV_FREE(path);
-    if (palettePath != NULL)
-        SRV_FREE(palettePath);
+    SRV_FREE(path);
+    SRV_FREE(palettePath);
 
     return (paletteDef);
 
@@ -372,6 +370,7 @@ ReadPaletteFile(
          error_value = 1;
          unlink(palettePath);
          SRV_FREE(fullPath);
+         close(fd);
          return((struct _palette *) NULL);
       }
    }