Skip to content

Commit e38c4d7

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 92306a8 commit e38c4d7

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
@@ -1472,7 +1472,9 @@ static void rpc_serve_client(ggml_backend_t backend, const char * cache_dir,
14721472
return;
14731473
}
14741474
rpc_msg_get_alloc_size_rsp response;
1475-
server.get_alloc_size(request, response);
1475+
if (!server.get_alloc_size(request, response)) {
1476+
return;
1477+
}
14761478
if (!send_msg(sockfd, &response, sizeof(response))) {
14771479
return;
14781480
}

0 commit comments

Comments
 (0)