From 2447614b9c283ee419543d480a8cb2918ce470e6 Mon Sep 17 00:00:00 2001 From: Christian Franke Date: Tue, 14 Jun 2016 20:07:07 +0200 Subject: [PATCH] pimd: don't leak original_s_route on error original_s_route is allocated on the heap and was not freed during the error case. Signed-off-by: Christian Franke Signed-off-by: Christian Franke Acked-by: Donald Sharp --- pimd/pim_static.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pimd/pim_static.c b/pimd/pim_static.c index c1154dc088..5882142b32 100644 --- a/pimd/pim_static.c +++ b/pimd/pim_static.c @@ -198,6 +198,10 @@ int pim_static_add(struct interface *iif, struct interface *oif, struct in_addr pim_static_route_free(s_route); } + if (original_s_route) { + pim_static_route_free(original_s_route); + } + return -1; }