summaryrefslogtreecommitdiff
path: root/lib/if_rmap.c
diff options
context:
space:
mode:
authoranlan_cs <vic.lan@pica8.com>2023-04-06 21:17:05 +0800
committeranlan_cs <vic.lan@pica8.com>2023-04-06 21:30:08 +0800
commitd3ec0066e5ea0edd691b939806cd7b879ac6a32a (patch)
tree3ed879a1c6c0deaf4f38e019df5e9a00a8d78afc /lib/if_rmap.c
parentcf35e49354699fb920997ba2448ea2088acb6a30 (diff)
ripd: Fix memory leak for ripd's route-map
When cleaning `ripd`, it should free `ctx->name` of `struct if_rmap_ctx`, not `ctx` itself. Otherwise, it will lead to memory leak. Signed-off-by: anlan_cs <vic.lan@pica8.com>
Diffstat (limited to 'lib/if_rmap.c')
-rw-r--r--lib/if_rmap.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/if_rmap.c b/lib/if_rmap.c
index 4a5bc36198..0d305a7af1 100644
--- a/lib/if_rmap.c
+++ b/lib/if_rmap.c
@@ -284,7 +284,7 @@ void if_rmap_ctx_delete(struct if_rmap_ctx *ctx)
listnode_delete(if_rmap_ctx_list, ctx);
hash_clean_and_free(&ctx->ifrmaphash, (void (*)(void *))if_rmap_free);
if (ctx->name)
- XFREE(MTYPE_IF_RMAP_CTX_NAME, ctx);
+ XFREE(MTYPE_IF_RMAP_CTX_NAME, ctx->name);
XFREE(MTYPE_IF_RMAP_CTX, ctx);
}