Memory leak happens while calling netdev_get_addr_list() function. This
function allocates memory for ip_addr and mask output arguments, but
this memory is never freed.
CC: Yifeng Sun <pkusunyifeng@gmail.com>
Fixes: dc0bd12f5b04 ("userspace: Enable non-bridge port as tunnel endpoint.")
Signed-off-by: Damijan Skvarc <damjan.skvarc@gmail.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
HMAP_FOR_EACH (port, ofp_node, &ctx->xbridge->xports) {
error = netdev_get_addr_list(port->netdev, &ip_addr,
&mask, &n_in6);
- if (!error && is_neighbor_reply_matched(flow, ip_addr)) {
- /* Found a match. */
- ret = true;
- break;
+ if (!error) {
+ ret = is_neighbor_reply_matched(flow, ip_addr);
+ free(ip_addr);
+ free(mask);
+ if (ret) {
+ /* Found a match. */
+ break;
+ }
}
}
}