[glib/wip/win32monitor: 2/4] gwin32fsmonitorutils: no need to check for NULL when using g_free



commit 922cd8424a353b170320453dbedc95db5282f627
Author: Ignacio Casal Quinteiro <icq gnome org>
Date:   Tue Mar 1 08:37:51 2016 +0100

    gwin32fsmonitorutils: no need to check for NULL when using g_free

 gio/win32/gwin32fsmonitorutils.c |   10 ++++------
 1 files changed, 4 insertions(+), 6 deletions(-)
---
diff --git a/gio/win32/gwin32fsmonitorutils.c b/gio/win32/gwin32fsmonitorutils.c
index 0b71309..43955e7 100644
--- a/gio/win32/gwin32fsmonitorutils.c
+++ b/gio/win32/gwin32fsmonitorutils.c
@@ -352,8 +352,7 @@ g_win32_fs_monitor_init (GWin32FSMonitorPrivate *monitor,
                                      FILE_FLAG_BACKUP_SEMANTICS | FILE_FLAG_OVERLAPPED,
                                      NULL);
 
-  if (wdirname_with_long_prefix != NULL)
-    g_free (wdirname_with_long_prefix);
+  g_free (wdirname_with_long_prefix);
   g_free (dirname_with_long_prefix);
 
   if (monitor->hDirectory != INVALID_HANDLE_VALUE)
@@ -405,11 +404,10 @@ void g_win32_fs_monitor_finalize (GWin32FSMonitorPrivate *monitor)
        */
       monitor->self = NULL;
     }
+
   g_free (monitor->wfullpath_with_long_prefix);
-  if (monitor->wfilename_long != NULL)
-    g_free (monitor->wfilename_long);
-  if (monitor->wfilename_short != NULL)
-    g_free (monitor->wfilename_short);
+  g_free (monitor->wfilename_long);
+  g_free (monitor->wfilename_short);
 }
 
 void g_win32_fs_monitor_close_handle (GWin32FSMonitorPrivate *monitor)


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]