/pidgin/main: e72f18aea857: oscar: Remove if() before g_free sin...

Youness Alaoui <[email protected]>
Newsgroups gmane.comp.gnome.gaim.cvs
Message-ID <[email protected]>
Changeset: e72f18aea857b544b77b5e989b34ed362b2abf0b
Author:	 Youness Alaoui <[email protected]>
Date:	 2016-06-16 13:09 -0400
Branch:	 oscar_auth
URL: https://hg.pidgin.im/pidgin/main/rev/e72f18aea857

Description:

oscar: Remove if() before g_free since g_free is NULL-aware

diffstat:

 libpurple/protocols/oscar/kerberos.c |  30 ++++++++++--------------------
 1 files changed, 10 insertions(+), 20 deletions(-)

diffs (59 lines):

diff --git a/libpurple/protocols/oscar/kerberos.c b/libpurple/protocols/oscar/kerberos.c
--- a/libpurple/protocols/oscar/kerberos.c
+++ b/libpurple/protocols/oscar/kerberos.c
@@ -93,8 +93,7 @@ static gchar *get_kdc_url(OscarData *od)
 	if (port != 443)
 		port_str = g_strdup_printf (":%d", port);
 	url = g_strdup_printf ("https://%s%s/", server, port_str ? port_str : "");
-	if (port_str)
-		g_free (port_str);
+	g_free (port_str);
 
 	return url;
 }
@@ -141,25 +140,18 @@ aim_xsnac_free(aim_xsnac_t *xsnac)
 {
 	gint i;
 
-	if (xsnac->principal1)
-		g_free (xsnac->principal1);
-	if (xsnac->principal2)
-		g_free (xsnac->principal2);
+	g_free (xsnac->principal1);
+	g_free (xsnac->principal2);
 	aim_tlvlist_free (xsnac->tlvlist);
 
 	for (i = 0; i < xsnac->num_tokens; i++) {
 		g_free(xsnac->tokens[i].main_tlv->value);
 		g_free(xsnac->tokens[i].main_tlv);
-		if (xsnac->tokens[i].principal1)
-			g_free (xsnac->tokens[i].principal1);
-		if (xsnac->tokens[i].principal1_again)
-		if (xsnac->tokens[i].service)
-			g_free (xsnac->tokens[i].service);
-			g_free (xsnac->tokens[i].principal1_again);
-		if (xsnac->tokens[i].principal2)
-			g_free (xsnac->tokens[i].principal2);
-		if (xsnac->tokens[i].footer)
-			g_free (xsnac->tokens[i].footer);
+		g_free (xsnac->tokens[i].principal1);
+		g_free (xsnac->tokens[i].service);
+		g_free (xsnac->tokens[i].principal1_again);
+		g_free (xsnac->tokens[i].principal2);
+		g_free (xsnac->tokens[i].footer);
 		aim_tlvlist_free (xsnac->tokens[i].tlvlist);
 	}
 	g_free (xsnac->tokens);
@@ -315,10 +307,8 @@ kerberos_login_cb(PurpleHttpConnection *
 			_("Unknown error during authentication"));
 	}
 	aim_xsnac_free (&xsnac);
-	if (tlsCertName)
-		g_free (tlsCertName);
-	if (bosip)
-		g_free (bosip);
+	g_free (tlsCertName);
+	g_free (bosip);
 }
 
 /**

_______________________________________________
Commits mailing list
[email protected]
https://pidgin.im/cgi-bin/mailman/listinfo/commits
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.