aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjames <james@e7ae566f-a301-0410-adde-c780ea21d3b5>2008-06-04 07:23:20 +0000
committerjames <james@e7ae566f-a301-0410-adde-c780ea21d3b5>2008-06-04 07:23:20 +0000
commitf7a66767251bdbb0e727b636d8abb036c1a043b5 (patch)
tree4c8e90317e48b86d9aaffa5a7f2fcf09deee939f
parentFixed an issue in extract_x509_field_ssl where the extraction (diff)
downloadopenvpn-f7a66767251bdbb0e727b636d8abb036c1a043b5.tar.xz
Fixed unbounded memory growth bug in
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
-rw-r--r--debug/valgrind-suppress14
-rwxr-xr-xdoval2
-rw-r--r--openvpn.c4
3 files changed, 18 insertions, 2 deletions
diff --git a/debug/valgrind-suppress b/debug/valgrind-suppress
index 69e2a3f..612c45e 100644
--- a/debug/valgrind-suppress
+++ b/debug/valgrind-suppress
@@ -114,3 +114,17 @@
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 76e0811..af840ee 100755
--- 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 $*
diff --git a/openvpn.c b/openvpn.c
index d3c36f9..f1bf169 100644
--- 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 ();