Don't check for null before calling free. I can't help but get rid

Tue, 12 Jun 2007 07:30:24 +0000

author
Mark Doliner <markdoliner@pidgin.im>
date
Tue, 12 Jun 2007 07:30:24 +0000
changeset 17702
15af85f94634
parent 17701
03f3f4f8b002
child 17703
4065ea2d3c2f

Don't check for null before calling free. I can't help but get rid
of these when I see them.

libpurple/protocols/jabber/presence.c file | annotate | diff | comparison | revisions
--- a/libpurple/protocols/jabber/presence.c	Tue Jun 12 05:22:44 2007 +0000
+++ b/libpurple/protocols/jabber/presence.c	Tue Jun 12 07:30:24 2007 +0000
@@ -379,8 +379,7 @@
 			} else if(xmlns && !strcmp(xmlns, "vcard-temp:x:update")) {
 				xmlnode *photo = xmlnode_get_child(y, "photo");
 				if(photo) {
-					if(avatar_hash)
-						g_free(avatar_hash);
+					g_free(avatar_hash);
 					avatar_hash = xmlnode_get_data(photo);
 				}
 			}
@@ -409,8 +408,7 @@
 			jabber_id_free(jid);
 			g_free(status);
 			g_free(room_jid);
-			if(avatar_hash)
-				g_free(avatar_hash);
+			g_free(avatar_hash);
 			return;
 		}
 
@@ -426,8 +424,7 @@
 				jabber_id_free(jid);
 				g_free(status);
 				g_free(room_jid);
-				if(avatar_hash)
-					g_free(avatar_hash);
+				g_free(avatar_hash);
 				return;
 			}
 
@@ -568,8 +565,7 @@
 	}
 	g_free(status);
 	jabber_id_free(jid);
-	if(avatar_hash)
-		g_free(avatar_hash);
+	g_free(avatar_hash);
 }
 
 void jabber_presence_subscription_set(JabberStream *js, const char *who, const char *type)

mercurial