From: "cron2 (Code Review)" Date: Mon, 9 Dec 2024 20:09:43 +0000 In-Reply-To: References: Reply-To: gert@...1296..., arne-openvpn@...1227..., openvpn-devel@lists.sourceforge.net, frank@...2641..., lstipakov@...277... Message-ID: <9d77e6708aea37f27bf32ca8a91ef17ec8024673-EmailReplacePatchSet-HTML@...2715...> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Disposition: inline Content-Type: multipart/alternative; boundary="QR2dWNGiOp8="; 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: flichtenheld , plaisthos , stipa Cc: openvpn-devel --QR2dWNGiOp8= Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable cron2 has uploaded a new patch set (#2) to the change originally created by= flichtenheld. ( http://gerrit.openvpn.net/c/openvpn/+/826?usp=3Demail ) The following approvals got outdated and were removed: Code-Review+2 by stipa 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 Acked-by: Lev Stipakov Message-Id: <20241209194957.358-1-gert@...1296...> URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg30= 049.html Signed-off-by: Gert Doering --- M tests/ntlm_support.c 1 file changed, 8 insertions(+), 4 deletions(-) git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/26/826/2 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: 2 Gerrit-Owner: flichtenheld Gerrit-Reviewer: plaisthos Gerrit-Reviewer: stipa Gerrit-CC: openvpn-devel Gerrit-MessageType: newpatchset --QR2dWNGiOp8= Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable

cron2 uploaded patch set #2 to the change originally cr= eated by flichtenheld.

View Change

The following approvals got outda= ted and were removed: Code-Review+2 by stipa

Fix memory leak in ntlm_support

Not really im= portant but prevents running the NTLM
t_client tests with ASAN enabled.<= br>
Change-Id: If472398d4ff8323de485f084a07160b365dfc501
Signed-off-b= y: Frank Lichtenheld <frank@...2641...>
Acked-by: Lev Stipakov <= ;lstipakov@...277...>
Message-Id: <20241209194957.358-1-gert@...1711...= 96...>
URL: https://www.mail-archive.com/openvpn-devel@...1357...= rge.net/msg30049.html
Signed-off-by: Gert Doering <gert@...1296...>= ;
---
M tests/ntlm_support.c
1 file changed, 8 insertions(+), 4 de= letions(-)

git pull ssh://gerrit.openvpn.net:29418/openvpn refs/c=
hanges/26/826/2
diff --git a/tests/ntlm_support.c b/tests/ntlm_supp=
ort.c
index ccf8962..18d555a 100644
--- a/t= ests/ntlm_support.c
+++ b/tests/ntlm_support.c
@@ -33,11 +33,11 @@
int
main(void)

{
-#if d= efined(ENABLE_CRYPTO_OPENSSL)
- crypto_load_provider("legacy");
- crypto_load_provider("default"= ;);
-#endif
<= span> #ifdef NTLM
+#i= f defined(ENABLE_CRYPTO_OPENSSL)
+ provider_t *legacy =3D crypto_load_provider("legacy&q= uot;);
+ provider_= t *def =3D crypto_load_provider("default");
+#endif
if (!md_valid= ("MD4"))
{
msg(M_FA= TAL, "MD4 not supported");
@@ -46,6 +46,10 @@
{
msg(M_FATAL, "MD5 not sup= ported");
}
+#if defined(ENABLE_CRYPTO_OPENSSL)
+ crypto_unload_provider("legacy&q= uot;, legacy);
+ c= rypto_unload_provider("default", def);
+#endif
#else /* ifdef NTLM *= /
msg(M_FATAL, "NTLM support not compiled in"= ;);
#endif

To view, vi= sit chang= e 826. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: If472398d4ff8323de485f084a07= 160b365dfc501
Gerrit-Change-Number: 826
Gerrit-PatchSet: 2
Gerrit-Owner: flichtenheld <frank@...2723...= .>
Gerrit-Reviewer: plaisthos <arne-openvpn@...1186...= .1227...>
Gerrit-Reviewer: stipa <lstipakov@...277...= >
Gerrit-CC: openvpn-devel <openvpn-devel@...1484...= ts.sourceforge.net>
Gerrit-MessageType: newpatchset
--QR2dWNGiOp8=--