summaryrefslogtreecommitdiffstats
path: root/pimd/pim_iface.c
diff options
context:
space:
mode:
authorDonald Sharp <sharpd@cumulusnetworks.com>2017-12-13 16:36:53 +0100
committerDonald Sharp <sharpd@cumulusnetworks.com>2017-12-14 16:43:53 +0100
commitb8ca17c230a1c324e34f96c61ccac3ef7357be8e (patch)
treefa3985c84015c74a8e228b879580270ed36d7356 /pimd/pim_iface.c
parentzebra: Remove possible NULL dereference in if_delete_connected (diff)
downloadfrr-b8ca17c230a1c324e34f96c61ccac3ef7357be8e.tar.xz
frr-b8ca17c230a1c324e34f96c61ccac3ef7357be8e.zip
pimd: Fix memory allocation error
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>
Diffstat (limited to 'pimd/pim_iface.c')
-rw-r--r--pimd/pim_iface.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/pimd/pim_iface.c b/pimd/pim_iface.c
index b2a8a6ff8..f02cf7ed3 100644
--- a/pimd/pim_iface.c
+++ b/pimd/pim_iface.c
@@ -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 =