[PATCH -ocserv 5/5] config: Use talloc_free() to free "route" strings

Kevin Cernekee cernekee at gmail.com
Sun Feb 8 17:26:40 PST 2015


Adding redundant routes triggers a glibc assertion on startup.  The offending
config file contained:

    route = 192.168.1.0/255.255.255.0
    route = default

The assertion:

    # ./src/ocserv -c ocserv.conf -f
    *** Error in `./src/ocserv': munmap_chunk(): invalid pointer: 0x0000000001703470 ***
    Aborted (core dumped)

Fix this by calling the correct free() function.
---
 src/config.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/config.c b/src/config.c
index 9ce93a1..4559688 100644
--- a/src/config.c
+++ b/src/config.c
@@ -718,7 +718,7 @@ unsigned force_cert_auth;
 		    strcmp(config->network.routes[j], "default") == 0) {
 		    	/* set default route */
 			for (i=0;i<j;i++)
-				free(config->network.routes[i]);
+				talloc_free(config->network.routes[i]);
 			config->network.routes_size = 0;
 			break;
 		}
-- 
1.9.1




More information about the openconnect-devel mailing list