From: Domagoj Pensa Date: Tue, 15 Dec 2020 17:16:00 +0000 (+0100) Subject: Fix too early argv freeing when registering DNS X-Git-Tag: v2.6_beta1~644 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ab4688e3bd78d010ccc96adec66ab552bd009328;p=thirdparty%2Fopenvpn.git Fix too early argv freeing when registering DNS When registering DNS on Windows, argv is freed after being used in first ipconfig command (/flushdns). Then same argv is used uninitialized in next ipconfig command (/registerdns) causing heap exception and subprocess crash. As a consequence second command is never executed and locked netcmd semaphore is not cleanly released. Removing argv freeing between ipconfig calls solves the problem. This issue was introduced in commit 870e240 (argv: do fewer memory re-allocations). After a quick glance at commit no similar problem was spotted in rest of the argv related changes. Signed-off-by: Domagoj Pensa Acked-by: Gert Doering Message-Id: <20201215171600.25534-1-domagoj@pensa.hr> URL: https://www.mail-archive.com/search?l=mid&q=20201215171600.25534-1-domagoj@pensa.hr Signed-off-by: Gert Doering --- diff --git a/src/openvpn/tun.c b/src/openvpn/tun.c index 400a50cac..2b227bb60 100644 --- a/src/openvpn/tun.c +++ b/src/openvpn/tun.c @@ -5235,7 +5235,6 @@ ipconfig_register_dns(const struct env_set *es) WIN_IPCONFIG_PATH_SUFFIX); argv_msg(D_TUNTAP_INFO, &argv); openvpn_execve_check(&argv, es, 0, err); - argv_free(&argv); argv_printf(&argv, "%s%s /registerdns", get_win_sys_path(),