changeset 16844:2afea2b41cab

Remove a bunch of unnecessary NULL checking for g_free()
author Daniel Atallah <daniel.atallah@gmail.com>
date Thu, 03 May 2007 23:16:09 +0000
parents 861987e9af41
children 30ab55257a16
files libpurple/protocols/msn/notification.c
diffstat 1 files changed, 6 insertions(+), 17 deletions(-) [+]
line wrap: on
line diff
--- a/libpurple/protocols/msn/notification.c	Thu May 03 23:13:03 2007 +0000
+++ b/libpurple/protocols/msn/notification.c	Thu May 03 23:16:09 2007 +0000
@@ -1142,33 +1142,25 @@
 
 	if ((value = msn_message_get_attr(msg, "kv")) != NULL)
 	{
-		if (session->passport_info.kv != NULL)
-			g_free(session->passport_info.kv);
-
+		g_free(session->passport_info.kv);
 		session->passport_info.kv = g_strdup(value);
 	}
 
 	if ((value = msn_message_get_attr(msg, "sid")) != NULL)
 	{
-		if (session->passport_info.sid != NULL)
-			g_free(session->passport_info.sid);
-
+		g_free(session->passport_info.sid);
 		session->passport_info.sid = g_strdup(value);
 	}
 
 	if ((value = msn_message_get_attr(msg, "MSPAuth")) != NULL)
 	{
-		if (session->passport_info.mspauth != NULL)
-			g_free(session->passport_info.mspauth);
-
+		g_free(session->passport_info.mspauth);
 		session->passport_info.mspauth = g_strdup(value);
 	}
 
 	if ((value = msn_message_get_attr(msg, "ClientIP")) != NULL)
 	{
-		if (session->passport_info.client_ip != NULL)
-			g_free(session->passport_info.client_ip);
-
+		g_free(session->passport_info.client_ip);
 		session->passport_info.client_ip = g_strdup(value);
 	}
 
@@ -1279,11 +1271,8 @@
 					  msn_user_get_passport(session->user),
 					  session->passport_info.file, NULL, NULL);
 
-	if (from != NULL)
-		g_free(from);
-
-	if (subject != NULL)
-		g_free(subject);
+	g_free(from);
+	g_free(subject);
 
 	g_hash_table_destroy(table);
 }