diff options
| author | Stephen Worley <sworley@cumulusnetworks.com> | 2020-04-06 14:13:20 -0400 | 
|---|---|---|
| committer | Stephen Worley <sworley@cumulusnetworks.com> | 2020-04-09 13:37:55 -0400 | 
| commit | 10fcd2a2a65496ef32c0c68e632f47b4233d1247 (patch) | |
| tree | f0d87ecff4090ec51de2aa6a5ded0fbd89181369 /pbrd/pbr_map.c | |
| parent | 1f375577f6965d64fe9c3ed5f210e87f51a00149 (diff) | |
pbrd: free nexthop_group name on `no set nexthop-group`
Properly free the string pointed to by `pbrms->nhgrp_name`
when we are removiing the config for a nexthop group
on a pbr map sequence.
Found via memleak:
==3152214== 4 bytes in 1 blocks are definitely lost in loss record 308 of 8,814
==3152214==    at 0x483980B: malloc (vg_replace_malloc.c:309)
==3152214==    by 0x4DC9F7E: strdup (in /usr/lib64/libc-2.30.so)
==3152214==    by 0x48E373E: qstrdup (memory.c:122)
==3152214==    by 0x408FE7: pbr_map_nexthop_group_magic (pbr_vty.c:264)
==3152214==    by 0x408E04: pbr_map_nexthop_group (pbr_vty_clippy.c:347)
==3152214==    by 0x48ACF72: cmd_execute_command_real (command.c:1073)
==3152214==    by 0x48ACB3B: cmd_execute_command (command.c:1133)
==3152214==    by 0x48AD063: cmd_execute (command.c:1288)
==3152214==    by 0x493D8EE: vty_command (vty.c:526)
==3152214==    by 0x493D397: vty_execute (vty.c:1293)
==3152214==    by 0x493C4EC: vtysh_read (vty.c:2126)
==3152214==    by 0x49319DC: thread_call (thread.c:1548)
Signed-off-by: Stephen Worley <sworley@cumulusnetworks.com>
Diffstat (limited to 'pbrd/pbr_map.c')
| -rw-r--r-- | pbrd/pbr_map.c | 2 | 
1 files changed, 1 insertions, 1 deletions
diff --git a/pbrd/pbr_map.c b/pbrd/pbr_map.c index e45e629649..95f97af945 100644 --- a/pbrd/pbr_map.c +++ b/pbrd/pbr_map.c @@ -384,7 +384,7 @@ static void pbr_map_delete_common(struct pbr_map_sequence *pbrms)  	pbrm->valid = false;  	pbrms->nhs_installed = false;  	pbrms->reason |= PBR_MAP_INVALID_NO_NEXTHOPS; -	pbrms->nhgrp_name = NULL; +	XFREE(MTYPE_TMP, pbrms->nhgrp_name);  }  void pbr_map_delete_nexthops(struct pbr_map_sequence *pbrms)  | 
