From: Yuanhan Liu Date: Tue, 18 Oct 2016 14:38:06 +0000 (+0800) Subject: vhost: fix use after free X-Git-Tag: spdx-start~5488 X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=54524e0391deabbb55e478d4a27d8983ff0b353a;p=dpdk.git vhost: fix use after free Fix the coverity USE_AFTER_FREE issue. Coverity issue: 137884 Fixes: a277c7159876 ("vhost: refactor code structure") Reported-by: John McNamara Signed-off-by: Yuanhan Liu --- diff --git a/lib/librte_vhost/socket.c b/lib/librte_vhost/socket.c index 967cb65379..aaa9c27077 100644 --- a/lib/librte_vhost/socket.c +++ b/lib/librte_vhost/socket.c @@ -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);