/pidgin/main: d96f03bbc4e6: Don't check for null before freeing.

Mark Doliner mark at kingant.net
Tue Jan 28 10:38:15 EST 2014


Changeset: d96f03bbc4e6950646d3dcec493f6e1405357291
Author:	 Mark Doliner <mark at kingant.net>
Date:	 2014-01-20 10:15 -0800
Branch:	 default
URL: https://hg.pidgin.im/pidgin/main/rev/d96f03bbc4e6

Description:

Don't check for null before freeing.

diffstat:

 libpurple/protocols/yahoo/libymsg.c |  9 +++------
 1 files changed, 3 insertions(+), 6 deletions(-)

diffs (35 lines):

diff --git a/libpurple/protocols/yahoo/libymsg.c b/libpurple/protocols/yahoo/libymsg.c
--- a/libpurple/protocols/yahoo/libymsg.c
+++ b/libpurple/protocols/yahoo/libymsg.c
@@ -491,12 +491,10 @@ static char *_getcookie(char *rawcookie)
 static void yahoo_process_cookie(YahooData *yd, char *c)
 {
 	if (c[0] == 'Y') {
-		if (yd->cookie_y)
-			g_free(yd->cookie_y);
+		g_free(yd->cookie_y);
 		yd->cookie_y = _getcookie(c);
 	} else if (c[0] == 'T') {
-		if (yd->cookie_t)
-			g_free(yd->cookie_t);
+		g_free(yd->cookie_t);
 		yd->cookie_t = _getcookie(c);
 	} else
 		purple_debug_info("yahoo", "Unrecognized cookie '%c'\n", c[0]);
@@ -1442,7 +1440,7 @@ static void yahoo_buddy_auth_req_15(Purp
 			yahoo_buddy_denied_our_add(gc, who, msg);
 		} else
 			purple_debug_error("yahoo", "Received unknown authorization response of %d from buddy '%s'.\n", response, who ? who : "(Unknown Buddy)");
-	g_free(who);
+		g_free(who);
 	}
 	/* Buddy requested authorization to add us. */
 	else if (pkt->status == 3) {
@@ -3826,7 +3824,6 @@ void yahoo_close(PurpleConnection *gc) {
 
 	for (l = yd->cookies; l; l = l->next) {
 		g_free(l->data);
-		l->data=NULL;
 	}
 	g_slist_free(yd->cookies);
 



More information about the Commits mailing list