vhost: fix use after free issue
PATCH 1/1 vhost: fix use after free issue
Fix the coverity USE_AFTER_FREE issue.
Fixes a277c7159876 ("vhost: refactor code structure")
Coverity issue: 137884
Reported-by John McNamara <[email protected]>
Signed-off-by Yuanhan Liu <[email protected]>
--- lib/librte_vhost/socket.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
lib/librte_vhost/socket.c +1 -1
@@ -250,8 +250,8 @@ vhost_user_read_cb(int connfd, void *dat, int *remove) vsocket->connfd =-1 ;close (connfd); *remove =1 ; -free (conn);vhost_destroy_device (conn->vid); +free (conn);if (vsocket->reconnect)vhost_user_create_client (vsocket);
Signature · 1 line
1.9.0
Yuanhan Liu
AppliedQuoted 7 lines · Yuanhan Liu
Fix the coverity
USE_AFTER_FREEissue.Fixes a277c7159876 ("vhost: refactor code structure")Coverity issue: 137884
Reported-by John McNamara <[email protected]>Signed-off-by Yuanhan Liu <[email protected]>
Applied to dpdk-next-virtio.
--yliu
Quoted 20 lines
--- lib/librte_vhost/socket.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)lib/librte_vhost/socket.c +1
-1@@ -250,8 +250,8 @@ vhost_user_read_cb(int connfd, void *dat, int *remove) vsocket->connfd =-1 ;close (connfd); *remove =1 ; -free (conn);vhost_destroy_device (conn->vid); +free (conn);if (vsocket->reconnect)vhost_user_create_client (vsocket);Signature · 1 line
1.9.0