Skip to content

Commit e6dd976

Browse files
committed
fix(rpc): Handle get_alloc_size failure in server
Check the return value of `server.get_alloc_size` in the RPC server loop. If the call fails, return early to close the connection. Signed-off-by: Ville Vesilehto <[email protected]>
1 parent f9ede76 commit e6dd976

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

ggml/src/ggml-rpc/ggml-rpc.cpp

+3-1
Original file line numberDiff line numberDiff line change
@@ -1463,7 +1463,9 @@ static void rpc_serve_client(ggml_backend_t backend, const char * cache_dir,
14631463
return;
14641464
}
14651465
rpc_msg_get_alloc_size_rsp response;
1466-
server.get_alloc_size(request, response);
1466+
if (!server.get_alloc_size(request, response)) {
1467+
return;
1468+
}
14671469
if (!send_msg(sockfd, &response, sizeof(response))) {
14681470
return;
14691471
}

0 commit comments

Comments
 (0)