diff options
| author | Carmine Scarpitta <carmine.scarpitta@uniroma2.it> | 2022-08-24 00:35:43 +0200 |
|---|---|---|
| committer | Carmine Scarpitta <carmine.scarpitta@uniroma2.it> | 2022-08-24 14:22:04 +0200 |
| commit | 6dece5ac29320c720e2f79ca0f52ebdad7615fc8 (patch) | |
| tree | fa62afad37ae846be5205b8c206f9a5b451cae23 /pimd/pim_cmd_common.c | |
| parent | a0c47583a43138f32cf4c1a3691c289d46ba2933 (diff) | |
sharpd: Fix memory leak in release-locator-chunk
Running the `zebra_seg6local_route` topotest with `--valgrind-memleaks`
gives several memory leak errors. This is due to the way SRv6 chunks are
released: when the user executes the CLI command
`sharp srv6-manager release-locator-chunk` to release the chunks of an
SRv6 locator, the `list_delete()` function is called to delete the
chunks list (`loc->chunks`), but the memory allocated for the chunks is
not freed.
This patch defines a new callback `sharp_srv6_locator_chunk_free()`.
This callback takes care of freeing the memory allocated for a given
chunk. When `list_delete()` is called to remove the chunk list
`loc->chunks`, it automatically calls `sharp_srv6_locator_chunk_free()`
on each element of the list to free the allocated memory before
deleting the list.
Signed-off-by: Carmine Scarpitta <carmine.scarpitta@uniroma2.it>
Diffstat (limited to 'pimd/pim_cmd_common.c')
0 files changed, 0 insertions, 0 deletions
