Browse Source

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 <chris@opensourcerouting.org>
Signed-off-by: Christian Franke <chris@opensourcerouting.org>
Acked-by: Donald Sharp <sharpd@cumulusnetworks.com>
Christian Franke 3 years ago
parent
commit
d1da1e9d18
1 changed files with 4 additions and 0 deletions
  1. 4 0
      pimd/pim_static.c

+ 4 - 0
pimd/pim_static.c

@@ -196,6 +196,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;
    }