From: "flichtenheld (Code Review)" Date: Mon, 9 Dec 2024 17:54:27 +0000 References: Reply-To: frank@...2641..., arne-openvpn@...1227..., openvpn-devel@lists.sourceforge.net Message-ID: <5254714c1a270a4f4c43ab6a1aa66f11fbf86e28-HTML@...2715...> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Disposition: inline Content-Type: multipart/alternative; boundary="5lmcXpBvwpM="; charset=UTF-8 Subject: [Openvpn-devel] [S] Change in openvpn[master]: Fix memory leak in ntlm_support List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: plaisthos Cc: openvpn-devel --5lmcXpBvwpM= Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Attention is currently required from: plaisthos. Hello plaisthos, I'd like you to do a code review. Please visit http://gerrit.openvpn.net/c/openvpn/+/826?usp=3Demail to review the following change. Change subject: Fix memory leak in ntlm_support ...................................................................... Fix memory leak in ntlm_support Not really important but prevents running the NTLM t_client tests with ASAN enabled. Change-Id: If472398d4ff8323de485f084a07160b365dfc501 Signed-off-by: Frank Lichtenheld --- M tests/ntlm_support.c 1 file changed, 8 insertions(+), 4 deletions(-) git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/26/826/1 diff --git a/tests/ntlm_support.c b/tests/ntlm_support.c index ccf8962..18d555a 100644 --- a/tests/ntlm_support.c +++ b/tests/ntlm_support.c @@ -33,11 +33,11 @@ int main(void) { -#if defined(ENABLE_CRYPTO_OPENSSL) - crypto_load_provider("legacy"); - crypto_load_provider("default"); -#endif #ifdef NTLM +#if defined(ENABLE_CRYPTO_OPENSSL) + provider_t *legacy =3D crypto_load_provider("legacy"); + provider_t *def =3D crypto_load_provider("default"); +#endif if (!md_valid("MD4")) { msg(M_FATAL, "MD4 not supported"); @@ -46,6 +46,10 @@ { msg(M_FATAL, "MD5 not supported"); } +#if defined(ENABLE_CRYPTO_OPENSSL) + crypto_unload_provider("legacy", legacy); + crypto_unload_provider("default", def); +#endif #else /* ifdef NTLM */ msg(M_FATAL, "NTLM support not compiled in"); #endif -- To view, visit http://gerrit.openvpn.net/c/openvpn/+/826?usp=3Demail To unsubscribe, or for help writing mail filters, visit http://gerrit.openv= pn.net/settings Gerrit-Project: openvpn Gerrit-Branch: master Gerrit-Change-Id: If472398d4ff8323de485f084a07160b365dfc501 Gerrit-Change-Number: 826 Gerrit-PatchSet: 1 Gerrit-Owner: flichtenheld Gerrit-Reviewer: plaisthos Gerrit-CC: openvpn-devel Gerrit-Attention: plaisthos Gerrit-MessageType: newchange --5lmcXpBvwpM= Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable

Attention is currently required from: plaisthos.

flichtenheld would like plaisthos to review this change.

Vi= ew Change

Fix memory leak in ntlm_support

Not really important b= ut prevents running the NTLM
t_client tests with ASAN enabled.

Ch= ange-Id: If472398d4ff8323de485f084a07160b365dfc501
Signed-off-by: Frank = Lichtenheld <frank@...2641...>
---
M tests/ntlm_support.c
1 = file changed, 8 insertions(+), 4 deletions(-)

git pull ssh://gerr=
it.openvpn.net:29418/openvpn refs/changes/26/826/1
diff --git a/tes=
ts/ntlm_support.c b/tests/ntlm_support.c
index ccf8962..18d= 555a 100644
--- a/tests/ntlm_support.c
+++ = b/tests/ntlm_support.c
@@ -33,11 +33,11 @@
= int
main(void)
{
-#if defined(ENABLE_CRYPTO_OPENSSL)- crypto_load_provider("= ;legacy");
- cr= ypto_load_provider("default");
-#endif
#ifdef NTLM
+#if defined(ENABLE_CRYPTO_OPENSSL)
+ provider_t *legacy = =3D crypto_load_provider("legacy");
+ provider_t *def =3D crypto_load_provider(&quo= t;default");
+#e= ndif
if (!md_valid("MD4"))
= {
msg(M_FATAL, "MD4 not supported");=
@@ -46,6 +46,10 @@
{
= msg(M_FATAL, "MD5 not supported");
= }
+#if defined(ENABLE= _CRYPTO_OPENSSL)
+ = crypto_unload_provider("legacy", legacy);
+ crypto_unload_provider("default&= quot;, def);
+#endif<= /span>
#else /* ifdef NTLM */
msg(M_FATAL, = "NTLM support not compiled in");
#endif

To view, visit change 826. To unsubscribe, or for he= lp writing mail filters, visit settings.

Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: If472398d4ff8323de485f084a07= 160b365dfc501
Gerrit-Change-Number: 826
Gerrit-PatchSet: 1
Gerrit-Owner: flichtenheld <frank@...2723...= .>
Gerrit-Reviewer: plaisthos <arne-openvpn@...1186...= .1227...>
Gerrit-CC: openvpn-devel <openvpn-devel@...1484...= ts.sourceforge.net>
Gerrit-Attention: plaisthos <arne-openvpn@...220...= ..1227...>
Gerrit-MessageType: newchange
--5lmcXpBvwpM=--