diff options
author | Carmine Scarpitta <carmine.scarpitta@uniroma2.it> | 2022-08-23 22:40:47 +0200 |
---|---|---|
committer | Carmine Scarpitta <carmine.scarpitta@uniroma2.it> | 2022-08-24 08:38:22 +0200 |
commit | 0a584672517a73e9d5ed5485941143036b28d290 (patch) | |
tree | 7e4149f96c785383f41d11fa3cadaf82515644f6 /zebra/zebra_srv6.c | |
parent | Merge pull request #11851 from sri-mohan1/sri-ospf-dbg1 (diff) | |
download | frr-0a584672517a73e9d5ed5485941143036b28d290.tar.xz frr-0a584672517a73e9d5ed5485941143036b28d290.zip |
zebra: Fix memory leak in SRv6 locator delete
Running `srv6_locator` topotest with `--valgrind-memleaks` gives several
memory leak errors. This is due to the way SRv6 locators are deleted:
when an SRv6 locator is deleted, it is removed from the SRv6 locators
list (`srv6->locators`), but the memory allocated for the SRv6 locator
is not freed.
This patch adds a call to the `srv6_locator_free()` function to properly
free the allocated memory when an SRv6 locator is removed.
Signed-off-by: Carmine Scarpitta <carmine.scarpitta@uniroma2.it>
Diffstat (limited to 'zebra/zebra_srv6.c')
-rw-r--r-- | zebra/zebra_srv6.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/zebra/zebra_srv6.c b/zebra/zebra_srv6.c index 219d04769..36506cacc 100644 --- a/zebra/zebra_srv6.c +++ b/zebra/zebra_srv6.c @@ -162,6 +162,7 @@ void zebra_srv6_locator_delete(struct srv6_locator *locator) } listnode_delete(srv6->locators, locator); + srv6_locator_free(locator); } struct srv6_locator *zebra_srv6_locator_lookup(const char *name) |