/pidgin/main: 029eb4abd1b0: Merging my scanbuild/coverity fix

Gary Kramlich grim at reaperworld.com
Tue May 10 23:10:34 EDT 2016


Changeset: 029eb4abd1b0dfabc1844f5841d990d22dbace1b
Author:	 Gary Kramlich <grim at reaperworld.com>
Date:	 2016-05-10 22:02 -0500
Branch:	 default
URL: https://hg.pidgin.im/pidgin/main/rev/029eb4abd1b0

Description:

Merging my scanbuild/coverity fix

diffstat:

 libpurple/http.c                      |  8 ++++----
 libpurple/protocols/jabber/presence.c |  4 +++-
 pidgin/gtkcertmgr.c                   |  4 ++--
 3 files changed, 9 insertions(+), 7 deletions(-)

diffs (63 lines):

diff --git a/libpurple/http.c b/libpurple/http.c
--- a/libpurple/http.c
+++ b/libpurple/http.c
@@ -2011,13 +2011,13 @@ void purple_http_cookie_jar_set(PurpleHt
 {
 	gchar *escaped_name = g_strdup(purple_url_encode(name));
 	gchar *escaped_value = NULL;
-	
-	if (escaped_value) {
+
+	if (value) {
 		escaped_value = g_strdup(purple_url_encode(value));
 	}
-	
+
 	purple_http_cookie_jar_set_ext(cookie_jar, escaped_name, escaped_value, -1);
-	
+
 	g_free(escaped_name);
 	g_free(escaped_value);
 }
diff --git a/libpurple/protocols/jabber/presence.c b/libpurple/protocols/jabber/presence.c
--- a/libpurple/protocols/jabber/presence.c
+++ b/libpurple/protocols/jabber/presence.c
@@ -305,6 +305,8 @@ PurpleXmlNode *jabber_presence_create_js
 	gboolean audio_enabled, video_enabled;
 #endif
 
+	g_return_val_if_fail(js !=NULL, NULL);
+
 	presence = purple_xmlnode_new("presence");
 
 	if(state == JABBER_BUDDY_STATE_UNAVAILABLE)
@@ -332,7 +334,7 @@ PurpleXmlNode *jabber_presence_create_js
 	}
 
 	/* if we are idle and not offline, include idle */
-	if (js && js->idle && state != JABBER_BUDDY_STATE_UNAVAILABLE) {
+	if (js->idle && state != JABBER_BUDDY_STATE_UNAVAILABLE) {
 		PurpleXmlNode *query = purple_xmlnode_new_child(presence, "query");
 		gchar seconds[10];
 		g_snprintf(seconds, 10, "%d", (int) (time(NULL) - js->idle));
diff --git a/pidgin/gtkcertmgr.c b/pidgin/gtkcertmgr.c
--- a/pidgin/gtkcertmgr.c
+++ b/pidgin/gtkcertmgr.c
@@ -317,7 +317,7 @@ tls_peers_mgmt_info_cb(GtkWidget *button
 	GtkTreeModel *model;
 	gchar *id;
 	GTlsCertificate *crt;
-	char *title;
+	gchar *title;
 	GError *error = NULL;
 
 	/* See if things are selected */
@@ -331,7 +331,7 @@ tls_peers_mgmt_info_cb(GtkWidget *button
 	gtk_tree_model_get(model, &iter, TPM_HOSTNAME_COLUMN, &id, -1);
 
 	/* Now retrieve the certificate */
-	crt = purple_tls_certificate_new_from_id(id, NULL);
+	crt = purple_tls_certificate_new_from_id(id, &error);
 
 	if (crt == NULL) {
 		purple_debug_warning("gtkcertmgr/tls_peers_mgmt",



More information about the Commits mailing list