From: "cron2 (Code Review)" Date: Mon, 9 Dec 2024 20:09:45 +0000 In-Reply-To: References: Reply-To: gert@...1296..., arne-openvpn@...1227..., openvpn-devel@lists.sourceforge.net, frank@...2641..., lstipakov@...277... Message-ID: <9d77e6708aea37f27bf32ca8a91ef17ec8024673-HTML@...2715...> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Disposition: inline Content-Type: multipart/alternative; boundary="l4aRDN0uElQ="; 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 Cc: stipa , plaisthos , openvpn-devel --l4aRDN0uElQ= Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable cron2 has submitted this change. ( http://gerrit.openvpn.net/c/openvpn/+/82= 6?usp=3Demail ) 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(-) 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: merged --l4aRDN0uElQ= Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable

cron2 submitted this change.

View Change

Fix memory leak in ntlm_support

Not rea= lly important but prevents running the NTLM
t_client tests with ASAN ena= bled.

Change-Id: If472398d4ff8323de485f084a07160b365dfc501
Signed= -off-by: Frank Lichtenheld <frank@...2641...>
Acked-by: Lev Stipak= ov <lstipakov@...277...>
Message-Id: <20241209194957.358-1-gert= @...1296...>
URL: https://www.mail-archive.com/openvpn-devel@...1466...= urceforge.net/msg30049.html
Signed-off-by: Gert Doering <gert@...1726...= ...>
---
M tests/ntlm_support.c
1 file changed, 8 insertions(+)= , 4 deletions(-)

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_lo= ad_provider("legacy");
- crypto_load_provider("default");
-#endif
#ifdef NTLM

+#if defined(ENABLE_CRYP= TO_OPENSSL)
+ prov= ider_t *legacy =3D crypto_load_provider("legacy");
+ provider_t *def =3D crypto_loa= d_provider("default");
+#endif
if (!md_valid("MD4"))
{
msg(M_FATAL, "MD4 not su= pported");
@@ -46,6 +46,10 @@
{
msg(M_FATAL, "MD5 not supported");=
}
+#if= defined(ENABLE_CRYPTO_OPENSSL)
+ crypto_unload_provider("legacy", legacy);<= br>+ crypto_unload_provider(= "default", def);
+#endif
#else /* ifdef NTLM */
= msg(M_FATAL, "NTLM support not compiled in");
#= endif

To view, visit change 826. To unsubscr= ibe, 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: merged
--l4aRDN0uElQ=--