]> git.puffer.fish Git - matthieu/frr.git/commitdiff
pimd: Fix memory allocation error
authorDonald Sharp <sharpd@cumulusnetworks.com>
Wed, 13 Dec 2017 15:36:53 +0000 (10:36 -0500)
committerDonald Sharp <sharpd@cumulusnetworks.com>
Thu, 14 Dec 2017 15:43:53 +0000 (10:43 -0500)
When creating the pim_ifp, and we run out of memory there
existed a chance that we would dereference the failed memory
pointer.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
pimd/pim_iface.c

index b2a8a6ff8f14867bb8386eb4833000242aae2c4c..f02cf7ed31c4555688646f64cb570e68268841cf 100644 (file)
@@ -205,6 +205,7 @@ struct pim_interface *pim_if_new(struct interface *ifp, int igmp, int pim)
        if (!pim_ifp->sec_addr_list) {
                zlog_err("%s: failure: secondary addresslist",
                         __PRETTY_FUNCTION__);
+               return if_list_clean(pim_ifp);
        }
        pim_ifp->sec_addr_list->del = (void (*)(void *))pim_sec_addr_free;
        pim_ifp->sec_addr_list->cmp =