]> git.ipfire.org Git - thirdparty/openvpn.git/commit
Fix (potential) memory leak in init_route_list()
authorSteffan Karger <steffan@karger.me>
Fri, 6 Nov 2015 07:42:39 +0000 (08:42 +0100)
committerGert Doering <gert@greenie.muc.de>
Tue, 10 Nov 2015 19:56:04 +0000 (20:56 +0100)
commit3671bd185a914dc1d91c8a967e1c3a14dedacd32
treee6c439c3ed961c0b88c513e71eb931f1efdbd64a
parentf107c62051ebbf4a2b661fcba8703fe26485c7af
Fix (potential) memory leak in init_route_list()

init_route() can allocate memory in netlist, but fail in many more ways
than just fail to allocate.  Thus, always check and clean up netlist if
needed, instead of just when init_route() succeeds.

This fix is for master only.  The release/2.3 branch cleans up netlist
immediately, and needs a different patch for a similar problem.

Found using coverity.

v2: initialize netlist to NULL

Signed-off-by: Steffan Karger <steffan@karger.me>
Acked-by: Gert Doering <gert@greenie.muc.de>
Message-Id: <1446795759-3288-1-git-send-email-steffan@karger.me>
URL: http://article.gmane.org/gmane.network.openvpn.devel/10443
Signed-off-by: Gert Doering <gert@greenie.muc.de>
src/openvpn/route.c