Skip to contentSkip to conversation

Fix memory leak in SSL_CTX_use_certificate

PATCH In review Steffan Karger 3 participants 3 messages Sep 26, 2018 – Sep 27, 2018

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Fix memory leak in SSL_CTX_use_certificate

Commit 98bfeeb4 introduced a memory leak in SSL_CTX_use_certificate by removing the "if(x509) { ... }" bit while not changing the "else if(x) {}" right after to an "if(x) {}".

---
 src/openvpn/ssl_openssl.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
src/openvpn/ssl_openssl.c +1 -1
index d9bc9d74..fe4db604 100644
@@ -855,7 +855,7 @@ end:
     {
         BIO_free(in);
     }
-    else if (x)
+    if (x)
     {
         X509_free(x);
     }
Signature · 1 line
2.17.1
Acked-by on v1 1/1
#1 lore raw

Am 26.09.18 um 21:27 schrieb Steffan Karger:

Quoted 3 lines

Commit 98bfeeb4 introduced a memory leak in SSL_CTX_use_certificate by removing the "if(x509) { ... }" bit while not changing the "else if(x) {}" right after to an "if(x) {}".

Hmpf, I should have spotted that.

Arne