diff options
| author | anlan_cs <vic.lan@pica8.com> | 2023-04-06 21:17:05 +0800 | 
|---|---|---|
| committer | Mergify <37929162+mergify[bot]@users.noreply.github.com> | 2023-04-11 11:38:25 +0000 | 
| commit | b8b3fc3d17fb4cdb92524f2d0b1e947a1eb04472 (patch) | |
| tree | 8124bdb6690f8d4a6d8b95bfd27b75a03a974b10 /lib | |
| parent | 7692f6a663f5ad0f24c59a17796422a9c61844a3 (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>
(cherry picked from commit d3ec0066e5ea0edd691b939806cd7b879ac6a32a)
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/if_rmap.c | 2 | 
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/if_rmap.c b/lib/if_rmap.c index 8282e476df..bd66ffae95 100644 --- a/lib/if_rmap.c +++ b/lib/if_rmap.c @@ -293,7 +293,7 @@ void if_rmap_ctx_delete(struct if_rmap_ctx *ctx)  	listnode_delete(if_rmap_ctx_list, ctx);  	hash_clean(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);  }  | 
