virtiofsd: cleanup allocated resource in se

This cleans up unfreed resources in se on quiting, including
se->virtio_dev, se->vu_socket_path, se->vu_socketfd.

Signed-off-by: Liu Bo <bo.liu@linux.alibaba.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
This commit is contained in:
Liu Bo 2019-06-07 05:43:52 +08:00 committed by Dr. David Alan Gilbert
parent c6de804670
commit 61cfc44982
3 changed files with 15 additions and 1 deletions

View file

@ -2532,6 +2532,13 @@ void fuse_session_destroy(struct fuse_session *se)
if (se->fd != -1) {
close(se->fd);
}
if (se->vu_socket_path) {
virtio_session_close(se);
free(se->vu_socket_path);
se->vu_socket_path = NULL;
}
free(se);
}