[phonemgr] trivial: g_free() accepts a NULL argument



commit 41b7a7a7b548335a9e09aa597c6494608f7587a0
Author: Daniele Forsi <dforsi src gnome org>
Date:   Fri Apr 27 14:48:51 2012 +0200

    trivial: g_free() accepts a NULL argument

 src/connection.c    |    3 +--
 src/e-phone-entry.c |    3 +--
 2 files changed, 2 insertions(+), 4 deletions(-)
---
diff --git a/src/connection.c b/src/connection.c
index a2676bc..d181257 100644
--- a/src/connection.c
+++ b/src/connection.c
@@ -69,8 +69,7 @@ set_connection_device (MyApp *app)
 	else if (dev != NULL && app->devname != NULL && strcmp (dev, app->devname) != 0)
 		changed = TRUE;
 
-	if (app->devname)
-		g_free (app->devname);
+	g_free (app->devname);
 	app->devname = dev;
 
 	g_message ("New connection device is %s (%s)",
diff --git a/src/e-phone-entry.c b/src/e-phone-entry.c
index 5e0cb41..5d25622 100644
--- a/src/e-phone-entry.c
+++ b/src/e-phone-entry.c
@@ -89,8 +89,7 @@ text_changed (GtkEditable *entry, gpointer user_data)
 		return;
 	}
 
-	if (pentry->text != NULL)
-		g_free (pentry->text);
+	g_free (pentry->text);
 	pentry->text = current;
 
 	if (pentry->phone_number != NULL) {



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