mirror of
https://github.com/openvswitch/ovs
synced 2025-09-02 23:35:27 +00:00
netdev-dpdk: Fix possible memory leak in vhost stats.
On error condition need to release the allocated structs.
Reported by Coverity.
Fixes: 3b29286db1
("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:
@@ -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;
|
||||
}
|
||||
|
Reference in New Issue
Block a user