[balsa] Unlock a mutex before returning



commit 49d84255147f2d752a396e5f95b8c1e448fc43fa
Author: Peter Bloomfield <PeterBloomfield bellsouth net>
Date:   Sat Aug 5 12:50:38 2017 -0400

    Unlock a mutex before returning
    
        * libbalsa/imap/imap-tls.c (imap_create_ssl): unlock
        global_tls_lock and print the SSL error stack before returning.

 ChangeLog                |    5 +++++
 libbalsa/imap/imap-tls.c |    3 +++
 2 files changed, 8 insertions(+), 0 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 61e3cdd..8f3939b 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2017-08-05  Peter Bloomfield  <pbloomfield bellsouth net>
+
+       * libbalsa/imap/imap-tls.c (imap_create_ssl): unlock
+       global_tls_lock and print the SSL error stack before returning.
+
 2017-08-05  Zhouyang Jia <jiazhouyang09 gmail com>
 
        * libbalsa/imap/imap-tls.c (imap_create_ssl): check for NULL
diff --git a/libbalsa/imap/imap-tls.c b/libbalsa/imap/imap-tls.c
index 47b3208..4376080 100644
--- a/libbalsa/imap/imap-tls.c
+++ b/libbalsa/imap/imap-tls.c
@@ -179,6 +179,9 @@ imap_create_ssl(void)
     global_ssl_context = SSL_CTX_new (SSLv23_client_method ());
     if(!global_ssl_context) {
         fprintf(stderr, "Could not initialize SSL Context.\n");
+        ERR_print_errors_fp(stderr);
+        fprintf(stderr, "\nEnd of print_errors\n");
+        g_mutex_unlock(&global_tls_lock);
         return NULL;
     }
 


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