Attention is currently required from: Arne Schwabe.

Hello Arne Schwabe,

I'd like you to do a code review.
Please visit

    https://gerrit.openvpn.net/c/openvpn/+/2183?usp=email

to review the following change.


Change subject: ssl_openssl: free what PKCS12_parse() returns
......................................................................

ssl_openssl: free what PKCS12_parse() returns

tls_ctx_load_pkcs12() never released its references to the
certificate, key and CA stack, leaking them on every SSL context
setup. The context takes its own references, except for extra chain
certificates, which it takes over.

Change-Id: I387f652ecba92283a272610ff0780273c4902996
Signed-off-by: Razvan Cojocaru <[email protected]>
---
M src/openvpn/ssl_openssl.c
1 file changed, 5 insertions(+), 0 deletions(-)



  git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/83/2183/1

diff --git a/src/openvpn/ssl_openssl.c b/src/openvpn/ssl_openssl.c
index fe2bfda..bb51d96 100644
--- a/src/openvpn/ssl_openssl.c
+++ b/src/openvpn/ssl_openssl.c
@@ -1009,6 +1009,7 @@
                 }
             }
         }
+        sk_X509_pop_free(ca, X509_free);
     }
     else
     {
@@ -1029,7 +1030,11 @@
                 }
             }
         }
+        /* the certs now belong to ctx */
+        sk_X509_free(ca);
     }
+    X509_free(cert);
+    EVP_PKEY_free(pkey);
     return 0;
 }


--
To view, visit https://gerrit.openvpn.net/c/openvpn/+/2183?usp=email
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.openvpn.net/settings?usp=email

Gerrit-MessageType: newchange
Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I387f652ecba92283a272610ff0780273c4902996
Gerrit-Change-Number: 2183
Gerrit-PatchSet: 1
Gerrit-Owner: Răzvan Cojocaru <[email protected]>
Gerrit-Reviewer: Arne Schwabe <[email protected]>
Gerrit-CC: openvpn-devel <[email protected]>
Gerrit-Attention: Arne Schwabe <[email protected]>
_______________________________________________
Openvpn-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openvpn-devel
  • [Openvpn-devel] [XS] Cha... Code Review

Reply via email to