diff gui/win32/gui.c @ 32537:8fa2f43cb760

Remove most of the NULL pointer check before free all over the code
author cboesch
date Sun, 14 Nov 2010 09:12:34 +0000
parents 312e3b425f0f
children c5a19bbeac2b
line wrap: on
line diff
--- a/gui/win32/gui.c	Sat Nov 13 10:23:34 2010 +0000
+++ b/gui/win32/gui.c	Sun Nov 14 09:12:34 2010 +0000
@@ -1007,7 +1007,7 @@
                             if(GetFileAttributes(searchpath) != INVALID_FILE_ATTRIBUTES)
                             {
 #ifdef CONFIG_DVDREAD
-                                if (dvd_device) free(dvd_device);
+                                free(dvd_device);
                                 dvd_device = strdup(device + pos);
                                 dvd_title = dvd_chapter = dvd_angle = 1;
                                 handlemsg(hWnd, evPlayDVD);
@@ -1017,7 +1017,7 @@
                             if(GetFileAttributes(searchpath) != INVALID_FILE_ATTRIBUTES)
                             {
 #ifdef CONFIG_LIBCDIO
-                                if (cdrom_device) free(cdrom_device);
+                                free(cdrom_device);
                                 cdrom_device = strdup(device + pos);
                                 /* mplayer doesn't seem to like the trailing \ after the device name */
                                 cdrom_device[2]=0;
@@ -1422,7 +1422,7 @@
     {
         mp_msg(MSGT_GPLAYER, MSGL_FATAL, "[GUI] fatal error during skinload\n");
         /* Set default Skin */
-        if (skinName) free(skinName);
+        free(skinName);
         skinName = strdup("Blue");
         /* then force write conf */
         cfg_write();