From a11944f52c85af49401c7b8f2b22a8a7c96794a9 Mon Sep 17 00:00:00 2001 From: Felix Fietkau Date: Mon, 18 Jun 2012 23:16:25 +0200 Subject: [PATCH] fix a memleak in host route dependency handling --- interface-ip.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/interface-ip.c b/interface-ip.c index 14feb6f..3957b48 100644 --- a/interface-ip.c +++ b/interface-ip.c @@ -160,8 +160,10 @@ interface_ip_add_target_route(union if_addr *addr, bool v6) interface_ip_find_route_target(iface, addr, v6, &r_next); } - if (!r_next) + if (!r_next) { + free(route); return NULL; + } iface = r_next->iface; memcpy(&route->nexthop, &r_next->nexthop, sizeof(route->nexthop)); -- 2.25.1