mirror of
https://github.com/openvswitch/ovs
synced 2025-08-31 06:15:47 +00:00
dpif-netdev: Fix leaked port, port->rxq, port->type in error path
Signed-off-by: Thomas Graf <tgraf@noironetworks.com> [blp@nicira.com added free of port->type] Signed-off-by: Ben Pfaff <blp@nicira.com>
This commit is contained in:
@@ -669,6 +669,9 @@ do_add_port(struct dp_netdev *dp, const char *devname, const char *type,
|
||||
VLOG_ERR("%s: cannot receive packets on this network device (%s)",
|
||||
devname, ovs_strerror(errno));
|
||||
netdev_close(netdev);
|
||||
free(port->type);
|
||||
free(port->rxq);
|
||||
free(port);
|
||||
return error;
|
||||
}
|
||||
}
|
||||
@@ -679,6 +682,7 @@ do_add_port(struct dp_netdev *dp, const char *devname, const char *type,
|
||||
netdev_rxq_close(port->rxq[i]);
|
||||
}
|
||||
netdev_close(netdev);
|
||||
free(port->type);
|
||||
free(port->rxq);
|
||||
free(port);
|
||||
return error;
|
||||
|
Reference in New Issue
Block a user