diff mbox

[PULL,01/13] vhost-user: fix memory leak

Message ID 1519922735-29054-2-git-send-email-mst@redhat.com (mailing list archive)
State New, archived
Headers show

Commit Message

Michael S. Tsirkin March 1, 2018, 4:45 p.m. UTC
From: linzhecheng <linzhecheng@huawei.com>

g_free() was moved from vhost_net_cleanup in commit e6bcb1b, so we should
free net after vhost_net_cleanup

Signed-off-by: linzhecheng <linzhecheng@huawei.com>
Reviewed-by: Marc-André Lureau < marcandre.lureau@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
---
 net/vhost-user.c | 1 +
 1 file changed, 1 insertion(+)
diff mbox

Patch

diff --git a/net/vhost-user.c b/net/vhost-user.c
index cb45512..d024573 100644
--- a/net/vhost-user.c
+++ b/net/vhost-user.c
@@ -109,6 +109,7 @@  static int vhost_user_start(int queues, NetClientState *ncs[], CharBackend *be)
 err:
     if (net) {
         vhost_net_cleanup(net);
+        g_free(net);
     }
     vhost_user_stop(i, ncs);
     return -1;