[libsoup] set_ssl_ca_file: don't try unreffing tlsdb if it's NULL



commit 91f1eea16dac133609a9a083f7e34d5d4ce44003
Author: Guillaume Desmottes <guillaume desmottes collabora co uk>
Date:   Thu Jan 17 10:59:13 2013 +0100

    set_ssl_ca_file: don't try unreffing tlsdb if it's NULL
    
    If g_tls_file_database_new() failed for any reason but
    G_TLS_ERROR_UNAVAILABLE, we don't create a fallback DB and so tlsdb stays
    NULL.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=691930

 libsoup/soup-session.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
---
diff --git a/libsoup/soup-session.c b/libsoup/soup-session.c
index bfc71fc..ab9e2cd 100644
--- a/libsoup/soup-session.c
+++ b/libsoup/soup-session.c
@@ -503,7 +503,8 @@ set_ssl_ca_file (SoupSession *session, const char *ssl_ca_file)
 	}
 
 	set_tlsdb (session, tlsdb);
-	g_object_unref (tlsdb);
+	if (tlsdb)
+		g_object_unref (tlsdb);
 
 	priv->ssl_ca_file = g_strdup (ssl_ca_file);
 	g_object_notify (G_OBJECT (session), "ssl-ca-file");



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]