The last of the NULL-checks before free()
--- a/finch/gntaccount.c Mon Dec 21 15:00:42 2015 -0500
+++ b/finch/gntaccount.c Mon Dec 21 15:05:58 2015 -0500
@@ -979,8 +979,7 @@
- if (data->alias != NULL)
--- a/libpurple/ciphers/hmaccipher.c Mon Dec 21 15:00:42 2015 -0500
+++ b/libpurple/ciphers/hmaccipher.c Mon Dec 21 15:05:58 2015 -0500
@@ -77,14 +77,10 @@
if(PURPLE_IS_HASH(priv->hash))
purple_hash_reset(priv->hash);
--- a/libpurple/http.c Mon Dec 21 15:00:42 2015 -0500
+++ b/libpurple/http.c Mon Dec 21 15:05:58 2015 -0500
@@ -751,8 +751,7 @@
req->http11 ? "1.1" : "1.0");
if (!purple_http_headers_get(hdrs, "host"))
g_string_append_printf(h, "Host: %s\r\n", url->host);
--- a/libpurple/network.c Mon Dec 21 15:00:42 2015 -0500
+++ b/libpurple/network.c Mon Dec 21 15:05:58 2015 -0500
@@ -1025,7 +1025,7 @@
purple_debug_info("network",
"network is unavailable, don't try to update STUN IP");
@@ -1044,7 +1044,7 @@
purple_debug_info("network",
"network is unavailable, don't try to update TURN IP");
@@ -1314,8 +1314,7 @@
purple_signal_unregister(purple_network_get_handle(),
"network-configuration-changed");
g_hash_table_destroy(upnp_port_mappings);
g_hash_table_destroy(nat_pmp_port_mappings);
--- a/libpurple/plugins/ssl/ssl-nss.c Mon Dec 21 15:00:42 2015 -0500
+++ b/libpurple/plugins/ssl/ssl-nss.c Mon Dec 21 15:05:58 2015 -0500
@@ -682,8 +682,7 @@
purple_debug_error("nss/x509",
"Certificate file has no contents!\n");
@@ -731,8 +730,7 @@
purple_debug_error("nss/x509",
"Certificate file has no contents!\n");
--- a/libpurple/protocols/gg/lib/http.c Mon Dec 21 15:00:42 2015 -0500
+++ b/libpurple/protocols/gg/lib/http.c Mon Dec 21 15:05:58 2015 -0500
@@ -312,10 +312,8 @@
if (res == -1 && errno != EINTR && errno != EAGAIN) {
gg_debug(GG_DEBUG_MISC, "=> http, reading header failed (errno=%d)\n", errno);
gg_http_error(GG_ERROR_READING);
@@ -328,10 +326,8 @@
gg_debug(GG_DEBUG_MISC, "=> http, connection reset by peer\n");
gg_http_error(GG_ERROR_READING);
@@ -447,10 +443,8 @@
if (res == -1 && errno != EINTR && errno != EAGAIN) {
gg_debug(GG_DEBUG_MISC, "=> http, reading body failed (errno=%d)\n", errno);
gg_http_error(GG_ERROR_READING);
@@ -472,10 +466,8 @@
"connection closed while reading "
h->body_done, h->body_size);
gg_http_error(GG_ERROR_READING);
--- a/libpurple/protocols/gg/roster.c Mon Dec 21 15:00:42 2015 -0500
+++ b/libpurple/protocols/gg/roster.c Mon Dec 21 15:05:58 2015 -0500
@@ -159,8 +159,7 @@
g_hash_table_destroy(content->group_ids);
if (content->group_names)
g_hash_table_destroy(content->group_names);
- if (content->bots_group_id)
- g_free(content->bots_group_id);
+ g_free(content->bots_group_id); --- a/libpurple/protocols/msn/object.c Mon Dec 21 15:00:42 2015 -0500
+++ b/libpurple/protocols/msn/object.c Mon Dec 21 15:05:58 2015 -0500
@@ -37,8 +37,7 @@
- if (obj->field != NULL) \
obj->field = g_strndup(tag, c - tag); \
--- a/libpurple/protocols/mxit/client.c Mon Dec 21 15:00:42 2015 -0500
+++ b/libpurple/protocols/mxit/client.c Mon Dec 21 15:05:58 2015 -0500
@@ -1906,20 +1906,17 @@
/* this is an invite, so update its profile info */
if ( ( statusMsg ) && ( *statusMsg ) ) {
/* update the status message */
- if ( contact->statusMsg )
- g_free( contact->statusMsg );
+ g_free(contact->statusMsg); contact->statusMsg = strdup( statusMsg );
contact->statusMsg = NULL;
- if ( contact->profile )
- g_free( contact->profile );
+ g_free(contact->profile); contact->profile = profile;
if ( ( avatarId ) && ( *avatarId ) ) {
/* avatar must be requested for this invite before we can display it */
mxit_get_avatar( session, mxitId, avatarId );
- if ( contact->avatarId )
- g_free( contact->avatarId );
+ g_free(contact->avatarId); contact->avatarId = strdup( avatarId );
@@ -1941,8 +1938,7 @@
contact = purple_buddy_get_protocol_data( buddy );
- if ( contact->statusMsg )
- g_free( contact->statusMsg );
+ g_free(contact->statusMsg); contact->statusMsg = strdup( statusMsg );
@@ -2926,12 +2922,9 @@
session->invites = g_list_remove( session->invites, contact );
- g_free( contact->msg );
- if ( contact->statusMsg )
- g_free( contact->statusMsg );
- if ( contact->profile )
- g_free( contact->profile );
+ g_free(contact->statusMsg); + g_free(contact->profile); g_object_unref(contact->image);
--- a/libpurple/protocols/mxit/formcmds.c Mon Dec 21 15:00:42 2015 -0500
+++ b/libpurple/protocols/mxit/formcmds.c Mon Dec 21 15:05:58 2015 -0500
@@ -303,8 +303,7 @@
g_string_append_printf(msg, "<a href=\"%s\">%s</a>", purple_url_decode(dest), (text) ? text : _( "Download" )); /* add link to display message */
--- a/libpurple/protocols/mxit/markup.c Mon Dec 21 15:00:42 2015 -0500
+++ b/libpurple/protocols/mxit/markup.c Mon Dec 21 15:05:58 2015 -0500
@@ -258,8 +258,7 @@
g_string_free( mx->msg, TRUE );
--- a/libpurple/protocols/mxit/multimx.c Mon Dec 21 15:00:42 2015 -0500
+++ b/libpurple/protocols/mxit/multimx.c Mon Dec 21 15:05:58 2015 -0500
@@ -164,8 +164,7 @@
session->rooms = g_list_remove(session->rooms, multimx);
- g_free(multimx->nickname);
+ g_free(multimx->nickname); --- a/libpurple/protocols/mxit/mxit.c Mon Dec 21 15:00:42 2015 -0500
+++ b/libpurple/protocols/mxit/mxit.c Mon Dec 21 15:05:58 2015 -0500
@@ -112,8 +112,7 @@
/* this is not an internal mxit link */
@@ -491,12 +490,9 @@
contact = purple_buddy_get_protocol_data( buddy );
- if ( contact->statusMsg )
- g_free( contact->statusMsg );
- if ( contact->avatarId )
- g_free( contact->avatarId );
- g_free( contact->msg );
+ g_free(contact->statusMsg); + g_free(contact->avatarId); g_object_unref(contact->image);
--- a/libpurple/protocols/mxit/roster.c Mon Dec 21 15:00:42 2015 -0500
+++ b/libpurple/protocols/mxit/roster.c Mon Dec 21 15:05:58 2015 -0500
@@ -481,10 +481,8 @@
// TODO: Download custom mood frame.
/* update status message */
- if ( contact->statusMsg ) {
- g_free( contact->statusMsg );
- contact->statusMsg = NULL;
+ g_free(contact->statusMsg); + contact->statusMsg = NULL; if ( ( statusMsg ) && ( statusMsg[0] != '\0' ) )
contact->statusMsg = g_markup_escape_text( statusMsg, -1 );
@@ -532,8 +530,7 @@
/* avatar has not changed - do nothing */
else if ( avatarId[0] != '\0' ) { /* avatar has changed */
- if ( contact->avatarId )
- g_free( contact->avatarId );
+ g_free(contact->avatarId); contact->avatarId = g_strdup( avatarId );
/* Send request to download new avatar image */
@@ -596,12 +593,9 @@
invite->session->invites = g_list_remove( invite->session->invites, invite->contact );
/* freeup invite object */
- if ( invite->contact->msg )
- g_free( invite->contact->msg );
- if ( invite->contact->statusMsg )
- g_free( invite->contact->statusMsg );
- if ( invite->contact->profile )
- g_free( invite->contact->profile );
+ g_free(invite->contact->msg); + g_free(invite->contact->statusMsg); + g_free(invite->contact->profile); if (invite->contact->image)
g_object_unref(invite->contact->image);
g_free( invite->contact );
@@ -627,12 +621,9 @@
invite->session->invites = g_list_remove( invite->session->invites, invite->contact );
/* freeup invite object */
- if ( invite->contact->msg )
- g_free( invite->contact->msg );
- if ( invite->contact->statusMsg )
- g_free( invite->contact->statusMsg );
- if ( invite->contact->profile )
- g_free( invite->contact->profile );
+ g_free(invite->contact->msg); + g_free(invite->contact->statusMsg); + g_free(invite->contact->profile); if (invite->contact->image)
g_object_unref(invite->contact->image);
g_free( invite->contact );
--- a/libpurple/protocols/oscar/family_locate.c Mon Dec 21 15:00:42 2015 -0500
+++ b/libpurple/protocols/oscar/family_locate.c Mon Dec 21 15:05:58 2015 -0500
@@ -549,14 +549,10 @@
* We don't have an away message specified in this user_info
* block, so clear any cached away message now.
- if (cur->away_encoding) {
- g_free(cur->away_encoding);
- cur->away_encoding = NULL;
+ g_free(cur->away_encoding); + cur->away_encoding = NULL; --- a/libpurple/protocols/yahoo/yahoochat.c Mon Dec 21 15:00:42 2015 -0500
+++ b/libpurple/protocols/yahoo/yahoochat.c Mon Dec 21 15:05:58 2015 -0500
@@ -727,8 +727,7 @@
c = purple_conversations_find_chat(gc, YAHOO_CHAT_ID);
/* we still get messages after we part, funny that */
@@ -955,10 +954,8 @@
yahoo_packet_send_and_free(pkt, yd);
if (purple_conversations_find_chat(gc, YAHOO_CHAT_ID) != NULL)
purple_serv_got_chat_left(gc, YAHOO_CHAT_ID);
--- a/libpurple/protocols/zephyr/zephyr.c Mon Dec 21 15:00:42 2015 -0500
+++ b/libpurple/protocols/zephyr/zephyr.c Mon Dec 21 15:05:58 2015 -0500
@@ -2313,10 +2313,8 @@
zephyr_account *zephyr = purple_connection_get_protocol_data(gc);
PurpleStatusPrimitive primitive = purple_status_type_get_primitive(purple_status_get_status_type(status));
if (primitive == PURPLE_STATUS_AWAY) {
zephyr->away = g_strdup(purple_status_get_attr_string(status,"message"));
--- a/libpurple/proxy.c Mon Dec 21 15:00:42 2015 -0500
+++ b/libpurple/proxy.c Mon Dec 21 15:05:58 2015 -0500
@@ -330,18 +330,12 @@
/* Free the old fields */
tmp = purple_gnome_proxy_get_parameter(GNOME_PROXY_USE_SAME_PROXY, gnome_version);