[gnome-commander] Remove unnecessary NULL check; g_free() is NULL-safe



commit 49b2c59f70768c30371c27088dd1805d5505f408
Author: Piotr Eljasiak <epiotr src gnome org>
Date:   Tue Feb 1 20:18:39 2011 +0100

    Remove unnecessary NULL check; g_free() is NULL-safe

 src/gnome-cmd-data.cc |    6 ++----
 1 files changed, 2 insertions(+), 4 deletions(-)
---
diff --git a/src/gnome-cmd-data.cc b/src/gnome-cmd-data.cc
index 09e1c14..0c601d8 100644
--- a/src/gnome-cmd-data.cc
+++ b/src/gnome-cmd-data.cc
@@ -1731,8 +1731,7 @@ const gchar *gnome_cmd_data_get_ftp_anonymous_password ()
 
 void gnome_cmd_data_set_ftp_anonymous_password (const gchar *pw)
 {
-    if (gnome_cmd_data.priv->ftp_anonymous_password)
-        g_free (gnome_cmd_data.priv->ftp_anonymous_password);
+    g_free (gnome_cmd_data.priv->ftp_anonymous_password);
 
     gnome_cmd_data.priv->ftp_anonymous_password = g_strdup (pw);
 }
@@ -1774,8 +1773,7 @@ GnomeCmdDateFormat gnome_cmd_data_get_date_format ()
 
 void gnome_cmd_data_set_date_format (GnomeCmdDateFormat format)
 {
-    if (gnome_cmd_data.priv->date_format)
-        g_free (gnome_cmd_data.priv->date_format);
+    g_free (gnome_cmd_data.priv->date_format);
 
     gnome_cmd_data.priv->date_format = g_strdup (format);
 }



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