summaryrefslogtreecommitdiff
path: root/hw/9pfs
diff options
context:
space:
mode:
Diffstat (limited to 'hw/9pfs')
-rw-r--r--hw/9pfs/virtio-9p-proxy.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/hw/9pfs/virtio-9p-proxy.c b/hw/9pfs/virtio-9p-proxy.c
index e6bbb06319..2ec211bbea 100644
--- a/hw/9pfs/virtio-9p-proxy.c
+++ b/hw/9pfs/virtio-9p-proxy.c
@@ -1155,10 +1155,12 @@ static int proxy_init(FsContext *ctx)
sock_id = atoi(ctx->fs_root);
if (sock_id < 0) {
fprintf(stderr, "socket descriptor not initialized\n");
- g_free(proxy);
- return -1;
}
}
+ if (sock_id < 0) {
+ g_free(proxy);
+ return -1;
+ }
g_free(ctx->fs_root);
ctx->fs_root = NULL;