[glib-networking/wip/openssl: 17/19] openssl: do not leak error if retrying the operation



commit 79308f8e9f75ac47b38ad9776a9fa1368a593ece
Author: Ignacio Casal Quinteiro <ignacio casal nice-software com>
Date:   Mon Apr 18 09:30:30 2016 +0200

    openssl: do not leak error if retrying the operation

 tls/openssl/gtlsconnection-openssl.c |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)
---
diff --git a/tls/openssl/gtlsconnection-openssl.c b/tls/openssl/gtlsconnection-openssl.c
index a2e9d4e..155e218 100644
--- a/tls/openssl/gtlsconnection-openssl.c
+++ b/tls/openssl/gtlsconnection-openssl.c
@@ -109,7 +109,11 @@ end_openssl_io (GTlsConnectionOpenssl  *openssl,
   if ((err_code == SSL_ERROR_WANT_READ ||
        err_code == SSL_ERROR_WANT_WRITE) &&
       status != G_TLS_CONNECTION_BASE_WOULD_BLOCK)
-    return G_TLS_CONNECTION_BASE_TRY_AGAIN;
+    {
+      if (my_error)
+        g_error_free (my_error);
+      return G_TLS_CONNECTION_BASE_TRY_AGAIN;
+    }
 
   if (err_code == SSL_ERROR_ZERO_RETURN)
     return G_TLS_CONNECTION_BASE_OK;


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