summaryrefslogtreecommitdiff
path: root/pbrd/pbr_nht.c
diff options
context:
space:
mode:
authorStephen Worley <sworley@cumulusnetworks.com>2020-04-06 12:51:55 -0400
committerStephen Worley <sworley@cumulusnetworks.com>2020-04-09 13:37:55 -0400
commit1f375577f6965d64fe9c3ed5f210e87f51a00149 (patch)
tree9de4f24565ad2e11a084f12e0655120e810e8631 /pbrd/pbr_nht.c
parentb21d304247554b770acfcfd15b82148fd109daf0 (diff)
pbrd: delete pbr nhg cache after rlease from hash
Actually delete the allocated pbr_nhg_cache object we just released. Found via memory leak: ==3078405== 136 bytes in 1 blocks are definitely lost in loss record 8,282 of 8,802 ==3078405== at 0x483BB1A: calloc (vg_replace_malloc.c:762) ==3078405== by 0x48E35E8: qcalloc (memory.c:110) ==3078405== by 0x40EBA7: pbr_nhgc_alloc (pbr_nht.c:194) ==3078405== by 0x48CC0EB: hash_get (hash.c:148) ==3078405== by 0x40F825: pbr_nht_add_individual_nexthop (pbr_nht.c:534) ==3078405== by 0x409853: pbr_map_nexthop_magic (pbr_vty.c:400) ==3078405== by 0x4093F1: pbr_map_nexthop (pbr_vty_clippy.c:417) ==3078405== by 0x48ACF72: cmd_execute_command_real (command.c:1073) ==3078405== by 0x48ACB3B: cmd_execute_command (command.c:1133) ==3078405== by 0x48AD063: cmd_execute (command.c:1288) ==3078405== by 0x493D8EE: vty_command (vty.c:526) ==3078405== by 0x493D397: vty_execute (vty.c:1293) Signed-off-by: Stephen Worley <sworley@cumulusnetworks.com>
Diffstat (limited to 'pbrd/pbr_nht.c')
-rw-r--r--pbrd/pbr_nht.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/pbrd/pbr_nht.c b/pbrd/pbr_nht.c
index ecd375333c..8a0168924d 100644
--- a/pbrd/pbr_nht.c
+++ b/pbrd/pbr_nht.c
@@ -564,6 +564,7 @@ void pbr_nht_delete_individual_nexthop(struct pbr_map_sequence *pbrms)
pbr_nht_uninstall_nexthop_group(pnhgc, *pbrms->nhg, nh_type);
hash_release(pbr_nhg_hash, pnhgc);
+ pbr_nhgc_delete(pnhgc);
nexthop_group_delete(&pbrms->nhg);
XFREE(MTYPE_TMP, pbrms->internal_nhg_name);