summaryrefslogtreecommitdiffstats
path: root/openvpn.c
diff options
context:
space:
mode:
authorDavid Sommerseth <davids@redhat.com>2012-02-06 00:30:47 +0100
committerDavid Sommerseth <davids@redhat.com>2012-02-08 14:37:46 +0100
commitdc7be6d078ba106f9b0de12f3e879c3561c3c537 (patch)
tree1f32a60f68a93f4dda7796de0174e4ddecbb2d0f /openvpn.c
parent82d4e12068774b0a6ca787ef1345b8a16c460466 (diff)
downloadopenvpn-dc7be6d078ba106f9b0de12f3e879c3561c3c537.tar.gz
openvpn-dc7be6d078ba106f9b0de12f3e879c3561c3c537.tar.xz
openvpn-dc7be6d078ba106f9b0de12f3e879c3561c3c537.zip
Fix assert() situations where gc_malloc() is called without a gc_arena object
In commit bee92b479414d12035b0422f81ac5fcfe14fa645 the gc_malloc() was hardened to always require a gc_arena object for garbage collection. Some places in the code expected the old behaviour of a normal malloc() in these cases, that is a memory allocation without garbage collection. This old behaviour is partly restored by allowing string_alloc() to do a non-gc based allocation if no gc_arena object is available. In addition some other places string_alloc() will now be called with a gc_arena pointer where such an object is available. The alloc_buf() function has also been refactored to not use gc_malloc() at all. v2: - removes a memleak when --ifconfig-ipv6 is used several times - makes string_alloc() behave properly if DMALLOC is enabled Signed-off-by: David Sommerseth <davids@redhat.com> Acked-by: Gert Doering <gert@greenie.muc.de>
Diffstat (limited to 'openvpn.c')
-rw-r--r--openvpn.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/openvpn.c b/openvpn.c
index f5f2bce..84289d2 100644
--- a/openvpn.c
+++ b/openvpn.c
@@ -164,7 +164,7 @@ main (int argc, char *argv[])
gc_init (&c.gc);
/* initialize environmental variable store */
- c.es = env_set_create (NULL);
+ c.es = env_set_create (&c.gc);
#ifdef WIN32
set_win_sys_path_via_env (c.es);
#endif