jsonrpc: fix error path of spdk_jsonrpc_parse_request()
Change-Id: Ia1bb2edefe31dc179986b9d4f8ea0d9002af0a40 Signed-off-by: wuzhouhui <wuzhouhui@kingsoft.com> Reviewed-on: https://review.gerrithub.io/424008 Reviewed-by: Changpeng Liu <changpeng.liu@intel.com> Reviewed-by: Jim Harris <james.r.harris@intel.com> Reviewed-by: Pawel Wodkowski <pawelx.wodkowski@intel.com> Chandler-Test-Pool: SPDK Automated Test System <sys_sgsw@intel.com> Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
This commit is contained in:
parent
28a61c2130
commit
4c8a350d02
@ -148,6 +148,7 @@ spdk_jsonrpc_parse_request(struct spdk_jsonrpc_server_conn *conn, void *json, si
|
||||
request->send_buf = malloc(request->send_buf_size);
|
||||
if (request->send_buf == NULL) {
|
||||
SPDK_ERRLOG("Failed to allocate send_buf (%zu bytes)\n", request->send_buf_size);
|
||||
conn->outstanding_requests--;
|
||||
free(request);
|
||||
return -1;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user