Skip to content

Commit

Permalink
ripd: use correct memory type when freeing BFD profile
Browse files Browse the repository at this point in the history
Fixes #13415.

Signed-off-by: Renato Westphal <[email protected]>
  • Loading branch information
rwestphal committed May 3, 2023
1 parent bf384bb commit 2da9c4c
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 3 deletions.
2 changes: 2 additions & 0 deletions ripd/rip_bfd.c
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
#include "ripd/rip_bfd.h"
#include "ripd/rip_debug.h"

DEFINE_MTYPE(RIPD, RIP_BFD_PROFILE, "RIP BFD profile name");

extern struct zclient *zclient;

static const char *rip_bfd_interface_profile(struct rip_interface *ri)
Expand Down
2 changes: 2 additions & 0 deletions ripd/rip_bfd.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@

#include "frrevent.h"

DECLARE_MTYPE(RIP_BFD_PROFILE);

struct rip;
struct rip_interface;
struct rip_peer;
Expand Down
3 changes: 2 additions & 1 deletion ripd/rip_interface.c
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
#include "zebra/connected.h"

#include "ripd/ripd.h"
#include "ripd/rip_bfd.h"
#include "ripd/rip_debug.h"
#include "ripd/rip_interface.h"

Expand Down Expand Up @@ -457,7 +458,7 @@ static void rip_interface_reset(struct rip_interface *ri)
ri->sent_updates = 0;

ri->passive = 0;
XFREE(MTYPE_TMP, ri->bfd.profile);
XFREE(MTYPE_RIP_BFD_PROFILE, ri->bfd.profile);

rip_interface_clean(ri);
}
Expand Down
2 changes: 0 additions & 2 deletions ripd/rip_nb_config.c
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,6 @@
#include "ripd/rip_interface.h"
#include "ripd/rip_bfd.h"

DEFINE_MTYPE_STATIC(RIPD, RIP_BFD_PROFILE, "RIP BFD profile name");

/*
* XPath: /frr-ripd:ripd/instance
*/
Expand Down

0 comments on commit 2da9c4c

Please sign in to comment.