Skip to content

Commit

Permalink
Merge pull request #13850 from Keelan10/pimd-leak-fix
Browse files Browse the repository at this point in the history
pimd: Fix memory leak in PIM interface deletion
  • Loading branch information
mobash-rasool authored Jun 28, 2023
2 parents 07a2b9d + 24379f0 commit 4d1f3d5
Showing 1 changed file with 4 additions and 9 deletions.
13 changes: 4 additions & 9 deletions pimd/pim_iface.c
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,8 @@

#include "pim6_mld.h"

#if PIM_IPV == 4
static void pim_if_igmp_join_del_all(struct interface *ifp);
#endif
static void pim_if_gm_join_del_all(struct interface *ifp);

static int gm_join_sock(const char *ifname, ifindex_t ifindex,
pim_addr group_addr, pim_addr source_addr,
struct pim_interface *pim_ifp);
Expand Down Expand Up @@ -189,11 +188,9 @@ void pim_if_delete(struct interface *ifp)
assert(pim_ifp);

pim_ifp->pim->mcast_if_count--;
#if PIM_IPV == 4
if (pim_ifp->gm_join_list) {
pim_if_igmp_join_del_all(ifp);
pim_if_gm_join_del_all(ifp);
}
#endif

pim_ifchannel_delete_all(ifp);
#if PIM_IPV == 4
Expand Down Expand Up @@ -1380,9 +1377,8 @@ int pim_if_gm_join_del(struct interface *ifp, pim_addr group_addr,
return 0;
}

#if PIM_IPV == 4
__attribute__((unused))
static void pim_if_igmp_join_del_all(struct interface *ifp)
static void pim_if_gm_join_del_all(struct interface *ifp)
{
struct pim_interface *pim_ifp;
struct listnode *node;
Expand All @@ -1402,7 +1398,6 @@ static void pim_if_igmp_join_del_all(struct interface *ifp)
for (ALL_LIST_ELEMENTS(pim_ifp->gm_join_list, node, nextnode, ij))
pim_if_gm_join_del(ifp, ij->group_addr, ij->source_addr);
}
#endif /* PIM_IPV == 4 */

/*
RFC 4601
Expand Down

0 comments on commit 4d1f3d5

Please sign in to comment.