From: David Sommerseth <dav...@redhat.com>

In commit dc7be6d078ba106f9b0de12f3e879c3561c3c537 the string_alloc() call
in pf_init_context() was modified to use the gc_arena object for memory
allocation.  What was not taken into consideration was that pf_destroy_context()
was also freeing memory allocated by string_alloc(), and when pf_init_context()
is calling gc_free() a double-free situation showed up.

Lets remove the explict free, and let gc_free take care of all the memory 
handling.

Reported-by: c...@163.com
Signed-off-by: David Sommerseth <dav...@redhat.com>
---
 src/openvpn/pf.c |    1 -
 1 file changed, 1 deletion(-)

diff --git a/src/openvpn/pf.c b/src/openvpn/pf.c
index 3c46801..aafe9ff 100644
--- a/src/openvpn/pf.c
+++ b/src/openvpn/pf.c
@@ -606,7 +606,6 @@ pf_destroy_context (struct pf_context *pfc)
   if (pfc->filename)
     {
       platform_unlink (pfc->filename);
-      free (pfc->filename);
     }
 #endif
   if (pfc->pfs)
-- 
1.7.10.2


Reply via email to