[Openvpn-devel] Fix memory leak in misc unit test

Message ID 20210503114043.3909319-1-arne@rfc2549.org
State Accepted
Headers show
Series
  • [Openvpn-devel] Fix memory leak in misc unit test
Related show

Commit Message

Arne Schwabe May 3, 2021, 11:40 a.m.
Detected-by: clang -fsanitize=address
Signed-off-by: Arne Schwabe <arne@rfc2549.org>
---
 tests/unit_tests/openvpn/test_misc.c | 1 +
 1 file changed, 1 insertion(+)

Comments

Gert Doering May 3, 2021, 1:08 p.m. | #1
Acked-by: Gert Doering <gert@greenie.muc.de>

Stare-at-code confirms.  "What goes in needs to come out" :-)

Your patch has been applied to the master branch.

commit 4a35d38efa74becf99ae9c6711f5c10c4b60f84b
Author: Arne Schwabe
Date:   Mon May 3 13:40:43 2021 +0200

     Fix memory leak in misc unit test

     Signed-off-by: Arne Schwabe <arne@rfc2549.org>
     Acked-by: Gert Doering <gert@greenie.muc.de>
     Message-Id: <20210503114043.3909319-1-arne@rfc2549.org>
     URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg22292.html
     Signed-off-by: Gert Doering <gert@greenie.muc.de>


--
kind regards,

Gert Doering

Patch

diff --git a/tests/unit_tests/openvpn/test_misc.c b/tests/unit_tests/openvpn/test_misc.c
index 15f6cbff6..c3bea8fc8 100644
--- a/tests/unit_tests/openvpn/test_misc.c
+++ b/tests/unit_tests/openvpn/test_misc.c
@@ -70,6 +70,7 @@  test_compat_lzo_string(void **state)
     /* 999 -> 1000, 3 to 4 chars */
     assert_string_equal(output, "V4,dev-type tun,link-mtu 1000,tun-mtu 1400,proto UDPv4,auth SHA1,keysize 128,key-method 2,tls-server,comp-lzo");
 
+    gc_free(&gc);
 };
 
 const struct CMUnitTest misc_tests[] = {