git.droids-corp.org
/
dpdk.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
f2f5bc8
)
vhost: fix use after free
author
Yuanhan Liu
<yuanhan.liu@linux.intel.com>
Tue, 18 Oct 2016 14:38:06 +0000
(22:38 +0800)
committer
Yuanhan Liu
<yuanhan.liu@linux.intel.com>
Wed, 26 Oct 2016 11:39:09 +0000
(13:39 +0200)
Fix the coverity USE_AFTER_FREE issue.
Coverity issue: 137884
Fixes:
a277c7159876
("vhost: refactor code structure")
Reported-by: John McNamara <john.mcnamara@intel.com>
Signed-off-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
lib/librte_vhost/socket.c
patch
|
blob
|
history
diff --git
a/lib/librte_vhost/socket.c
b/lib/librte_vhost/socket.c
index
967cb65
..
aaa9c27
100644
(file)
--- 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);