diff libpurple/protocols/msn/msg.c @ 20991:c8f99cb61dc9

Cleanup some unnecessary NULL checks in g_strdup()/g_free().
author Daniel Atallah <daniel.atallah@gmail.com>
date Fri, 19 Oct 2007 01:38:35 +0000
parents 2097b1664fa3
children ba47ec8a2477
line wrap: on
line diff
--- a/libpurple/protocols/msn/msg.c	Fri Oct 19 01:28:55 2007 +0000
+++ b/libpurple/protocols/msn/msg.c	Fri Oct 19 01:38:35 2007 +0000
@@ -60,17 +60,10 @@
 	purple_debug_info("msn", "message destroy (%p)\n", msg);
 #endif
 
-	if (msg->remote_user != NULL)
-		g_free(msg->remote_user);
-
-	if (msg->body != NULL)
-		g_free(msg->body);
-
-	if (msg->content_type != NULL)
-		g_free(msg->content_type);
-
-	if (msg->charset != NULL)
-		g_free(msg->charset);
+	g_free(msg->remote_user);
+	g_free(msg->body);
+	g_free(msg->content_type);
+	g_free(msg->charset);
 
 	g_hash_table_destroy(msg->attr_table);
 	g_list_free(msg->attr_list);
@@ -556,10 +549,8 @@
 {
 	g_return_if_fail(msg != NULL);
 
-	if (msg->content_type != NULL)
-		g_free(msg->content_type);
-
-	msg->content_type = (type != NULL) ? g_strdup(type) : NULL;
+	g_free(msg->content_type);
+	msg->content_type = g_strdup(type);
 }
 
 const char *
@@ -575,10 +566,8 @@
 {
 	g_return_if_fail(msg != NULL);
 
-	if (msg->charset != NULL)
-		g_free(msg->charset);
-
-	msg->charset = (charset != NULL) ? g_strdup(charset) : NULL;
+	g_free(msg->charset);
+	msg->charset = g_strdup(charset);
 }
 
 const char *