From cbe50989d94c549de23e35f15121321fe56fd40e Mon Sep 17 00:00:00 2001 From: anlan_cs Date: Thu, 15 Aug 2024 20:49:24 +0800 Subject: [PATCH] pimd: fix missing checking the return value for igmp command `gm_join_new()` will return NULL in the case of running out of socket/file resources. Just add the check for it. Signed-off-by: anlan_cs --- pimd/pim_iface.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/pimd/pim_iface.c b/pimd/pim_iface.c index dcb6116012e5..cdcca0ebe6e0 100644 --- a/pimd/pim_iface.c +++ b/pimd/pim_iface.c @@ -1322,7 +1322,10 @@ ferr_r pim_if_gm_join_add(struct interface *ifp, pim_addr group_addr, return ferr_ok(); } - (void)gm_join_new(ifp, group_addr, source_addr); + if (!gm_join_new(ifp, group_addr, source_addr)) { + return ferr_cfg_invalid("can't join (%pPA,%pPA) on interface %s", + &source_addr, &group_addr, ifp->name); + } if (PIM_DEBUG_GM_EVENTS) { zlog_debug(