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 | |
| parent | c143b875193c0ec4eaaeb1f0ddb2c744bd04ba3c (diff) | |
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')
| -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 219d047694..36506cacc7 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)  | 
