[glib-networking/wip/openssl] Use g_set_object



commit 98c4d7f321e6585b6db782cd1ced3cd113205456
Author: Paolo Borelli <pborelli gnome org>
Date:   Sun Jun 19 12:34:09 2016 +0200

    Use g_set_object

 tls/base/gtlsconnection-base.c |    6 +-----
 1 files changed, 1 insertions(+), 5 deletions(-)
---
diff --git a/tls/base/gtlsconnection-base.c b/tls/base/gtlsconnection-base.c
index 4f39fbf..d32d778 100644
--- a/tls/base/gtlsconnection-base.c
+++ b/tls/base/gtlsconnection-base.c
@@ -739,11 +739,7 @@ g_tls_connection_base_set_peer_certificate (GTlsConnectionBase   *tls,
                                            GTlsCertificate      *peer_certificate,
                                            GTlsCertificateFlags  peer_certificate_errors)
 {
-  if (tls->peer_certificate)
-    g_object_unref (tls->peer_certificate);
-  tls->peer_certificate = peer_certificate;
-  if (tls->peer_certificate)
-    g_object_ref (tls->peer_certificate);
+  g_set_object(&tls->peer_certificate, peer_certificate);
 
   tls->peer_certificate_errors = peer_certificate_errors;
 


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