Skip to content

Commit

Permalink
interfaces-plugin: free all allocated address libnl data in prefix-le…
Browse files Browse the repository at this point in the history
…ngth and netmask callbacks
  • Loading branch information
zinccyy committed Oct 11, 2022
1 parent e551a8a commit f23c952
Showing 1 changed file with 24 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,18 @@ int interfaces_interface_ipv4_address_change_netmask(void* priv, sr_session_ctx_
rtnl_addr_put(request_addr);
}

if (delete_addr) {
rtnl_addr_put(delete_addr);
}

if (old_local_addr) {
nl_addr_put(old_local_addr);
}

if (local_addr) {
nl_addr_put(local_addr);
}

return error;
}

Expand Down Expand Up @@ -239,6 +251,18 @@ int interfaces_interface_ipv4_address_change_prefix_length(void* priv, sr_sessio
rtnl_addr_put(request_addr);
}

if (delete_addr) {
rtnl_addr_put(delete_addr);
}

if (old_local_addr) {
nl_addr_put(old_local_addr);
}

if (local_addr) {
nl_addr_put(local_addr);
}

return error;
}

Expand Down

0 comments on commit f23c952

Please sign in to comment.