Commit 5159e08
fabrics: fix mem leak at nvmf_discovery_config_file()
Valgrind revealed a mem leak caused due to not invoking
parser_cleanup for the corresponding parser_init at
nvmf_discovery_config_file():
==16682== 256 bytes in 1 blocks are definitely lost in loss record 1 of 2
==16682== at 0x4848C31: calloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==16682== by 0x40881A: cb_parser_init (fabrics.c:254)
==16682== by 0x487B8A2: nvmf_discovery_config_file (fabrics.c:2554)
==16682== by 0x4099F6: fabrics_discovery (fabrics.c:574)
==16682== by 0x446358: handle_plugin (plugin.c:190)
==16682== by 0x407760: main (nvme.c:11029)
==16682==
==16682== 472 bytes in 1 blocks are still reachable in loss record 2 of 2
==16682== at 0x4841984: malloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==16682== by 0x494C7CA: __fopen_internal (in /lib64/libc.so.6)
==16682== by 0x408802: cb_parser_init (fabrics.c:248)
==16682== by 0x487B8A2: nvmf_discovery_config_file (fabrics.c:2554)
==16682== by 0x4099F6: fabrics_discovery (fabrics.c:574)
==16682== by 0x446358: handle_plugin (plugin.c:190)
==16682== by 0x407760: main (nvme.c:11029)
Fix the same.
Signed-off-by: Martin George <[email protected]>1 parent 4d3d6ac commit 5159e08
1 file changed
Lines changed: 2 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2588 | 2588 | | |
2589 | 2589 | | |
2590 | 2590 | | |
| 2591 | + | |
| 2592 | + | |
2591 | 2593 | | |
2592 | 2594 | | |
2593 | 2595 | | |
| |||
0 commit comments