mirror of
https://github.com/apache/nuttx.git
synced 2026-08-02 12:49:00 +00:00
net/netlink: fix memory leak in netlink_get_neighbor
Add kmm_free(alloc) before returning NULL when neigh is NULL in netlink_get_neighbor(). Without this, the allocated memory is leaked on the error path. Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
This commit is contained in:
parent
244ddfcc2c
commit
c6c7cf6bba
1 changed files with 1 additions and 0 deletions
|
|
@ -694,6 +694,7 @@ netlink_get_neighbor(FAR const void *neigh, int domain, int type,
|
|||
{
|
||||
if (neigh == NULL)
|
||||
{
|
||||
kmm_free(alloc);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue