]> git.ipfire.org Git - thirdparty/openvpn.git/commitdiff
Fixed unbounded memory growth bug in
authorjames <james@e7ae566f-a301-0410-adde-c780ea21d3b5>
Wed, 4 Jun 2008 07:23:20 +0000 (07:23 +0000)
committerjames <james@e7ae566f-a301-0410-adde-c780ea21d3b5>
Wed, 4 Jun 2008 07:23:20 +0000 (07:23 +0000)
environmental variable code that could
have caused long-running OpenVPN sessions
with many TLS renegotiations to incrementally
increase memory usage over time.

git-svn-id: http://svn.openvpn.net/projects/openvpn/branches/BETA21/openvpn@2981 e7ae566f-a301-0410-adde-c780ea21d3b5

debug/valgrind-suppress
doval
openvpn.c

index 69e2a3f5f083c5654dcafe5406f2dba535d8de78..612c45ec6c7e5d1532444b0bcd5a571727b5073f 100644 (file)
    Memcheck:Cond
    obj:/lib/ld-2.5.so
 }
+
+{
+   <insert a suppression name here>
+   Memcheck:Leak
+   fun:malloc
+   fun:CRYPTO_malloc
+   fun:sk_new
+   obj:/usr/lib/libssl.so.0.9.8
+   fun:SSL_COMP_get_compression_methods
+   fun:SSL_library_init
+   fun:init_ssl_lib
+   fun:init_static
+   fun:main
+}
diff --git a/doval b/doval
index 76e0811f11c6754a7ac37d3f0a3162cc82d4fb7b..af840ee533b81c8a6711938d3860d667c59f484c 100755 (executable)
--- a/doval
+++ b/doval
@@ -1,2 +1,2 @@
 #!/bin/bash
-valgrind --tool=memcheck --error-limit=no --suppressions=debug/valgrind-suppress --gen-suppressions=all --leak-check=yes --num-callers=32 $*
+valgrind --tool=memcheck --error-limit=no --suppressions=debug/valgrind-suppress --gen-suppressions=all --leak-check=full --show-reachable=yes --num-callers=32 $*
index d3c36f96c4404a456507925310fd2ca0fe0e4a5a..f1bf16909aa95bbd971c777cbdf85b54a65af20d 100644 (file)
--- a/openvpn.c
+++ b/openvpn.c
@@ -130,7 +130,7 @@ main (int argc, char *argv[])
          gc_init (&c.gc);
 
          /* initialize environmental variable store */
-         c.es = env_set_create (&c.gc);
+         c.es = env_set_create (NULL);
 
 #ifdef ENABLE_MANAGEMENT
          /* initialize management subsystem */
@@ -233,6 +233,8 @@ main (int argc, char *argv[])
 
   context_gc_free (&c);
 
+  env_set_destroy (c.es);
+
 #ifdef ENABLE_MANAGEMENT
   /* close management interface */
   close_management ();