mirror of
https://github.com/openvswitch/ovs
synced 2025-08-22 18:07:40 +00:00
netdev-dpdk: Fix possible memory leak in vhost stats.
On error condition need to release the allocated structs. Reported by Coverity. Fixes: 3b29286db1c5 ("netdev-dpdk: Add per virtqueue statistics.") Signed-off-by: Roi Dayan <roid@nvidia.com> Signed-off-by: Kevin Traynor <ktraynor@redhat.com>
This commit is contained in:
parent
7e3a0b4961
commit
b42f9fde4a
@ -3785,15 +3785,12 @@ netdev_dpdk_vhost_get_custom_stats(const struct netdev *netdev,
|
||||
stat_offset += vhost_txq_stats_count;
|
||||
}
|
||||
|
||||
free(vhost_stats_names);
|
||||
vhost_stats_names = NULL;
|
||||
free(vhost_stats);
|
||||
vhost_stats = NULL;
|
||||
|
||||
out:
|
||||
ovs_mutex_unlock(&dev->mutex);
|
||||
|
||||
custom_stats->size = stat_offset;
|
||||
free(vhost_stats_names);
|
||||
free(vhost_stats);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user