Skip to content

Commit 6af76c6

Browse files
author
Michael Tokarev
committed
virtio-9p-proxy: fix error return in proxy_init()
proxy_init() does not check the return value of connect_namedsocket(), fix this by rearranging code a little bit. Signed-off-by: Michael Tokarev <[email protected]>
1 parent 660edd4 commit 6af76c6

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

hw/9pfs/virtio-9p-proxy.c

+4-2
Original file line numberDiff line numberDiff line change
@@ -1155,10 +1155,12 @@ static int proxy_init(FsContext *ctx)
11551155
sock_id = atoi(ctx->fs_root);
11561156
if (sock_id < 0) {
11571157
fprintf(stderr, "socket descriptor not initialized\n");
1158-
g_free(proxy);
1159-
return -1;
11601158
}
11611159
}
1160+
if (sock_id < 0) {
1161+
g_free(proxy);
1162+
return -1;
1163+
}
11621164
g_free(ctx->fs_root);
11631165
ctx->fs_root = NULL;
11641166

0 commit comments

Comments
 (0)