Commit 04f8a3a
committed
ip6: fix memory leak when show ip6 router-advert fails
grout# show ip6 router-advert
error: command failed: Bad message
grout# ^D
==174902==ERROR: LeakSanitizer: detected memory leaks
Direct leak of 328 byte(s) in 1 object(s) allocated from:
#0 0x7fe0ca6c2250 in calloc (/lib64/libasan.so.8+0xc2250)
#1 0x7fe0cadef910 in scols_new_table (/lib64/libsmartcols.so.1+0x6910)
DPDK#2 0x417d0f in ra_show ../modules/ip6/cli/router_advert.c:19
DPDK#3 0x41e836 in exec_strvec ../cli/exec.c:72
DPDK#4 0x41e982 in exec_line ../cli/exec.c:106
DPDK#5 0x41f412 in interact ../cli/interact.c:119
DPDK#6 0x4216db in main ../cli/main.c:167
...
DPDK#9 0x4017f4 in _start (/root/grout/build/grcli+0x4017f4)
Only allocate the table if the GR_IP6_IFACE_RA_SHOW api call is
successful.
Fixes: 8ed8b9d ("ip6: router advertisement configuration")
Signed-off-by: Robin Jarry <[email protected]>1 parent 8be8495 commit 04f8a3a
1 file changed
Lines changed: 1 addition & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
16 | | - | |
17 | | - | |
18 | 16 | | |
19 | | - | |
20 | 17 | | |
21 | 18 | | |
22 | 19 | | |
| |||
31 | 28 | | |
32 | 29 | | |
33 | 30 | | |
| 31 | + | |
34 | 32 | | |
35 | 33 | | |
36 | 34 | | |
| |||
0 commit comments