vhost: fix use after free
authorYuanhan Liu <yuanhan.liu@linux.intel.com>
Mon, 17 Apr 2017 07:27:04 +0000 (15:27 +0800)
committerYuanhan Liu <yuanhan.liu@linux.intel.com>
Wed, 19 Apr 2017 08:49:06 +0000 (10:49 +0200)
commit7bd841b2691a428ac70f965a6ee352728da9c0f3
tree1bab904f2d0d8b63f84c0816a3dd97af98aa9b72
parent4bf9e26d29caccda42d77601b26791e146d08d9a
vhost: fix use after free

A "return" is missing on error, which could lead to a "use after free"
issue (about var "conn").

Coverity issue: 143476
Fixes: 65388b43f592 ("vhost: fix fd leaks for vhost-user server mode")

Reported-by: John McNamara <john.mcnamara@intel.com>
Signed-off-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
lib/librte_vhost/socket.c