From: Jeremy Allison Date: Wed, 7 Sep 2022 18:12:08 +0000 (-0700) Subject: s3: libsmb: Add missing memory allocation fail checks in cli_ntcreate1_send(). X-Git-Tag: talloc-2.4.0~1042 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a213a371aeb2fae4df0f41e85faca2cfd38f6447;p=thirdparty%2Fsamba.git s3: libsmb: Add missing memory allocation fail checks in cli_ntcreate1_send(). Signed-off-by: Jeremy Allison Reviewed-by: Noel Power --- diff --git a/source3/libsmb/clifile.c b/source3/libsmb/clifile.c index 4cc9f231c37..86a6b58a6ed 100644 --- a/source3/libsmb/clifile.c +++ b/source3/libsmb/clifile.c @@ -2505,9 +2505,15 @@ static struct tevent_req *cli_ntcreate1_send(TALLOC_CTX *mem_ctx, SCVAL(vwv+23, 1, SecurityFlags); bytes = talloc_array(state, uint8_t, 0); + if (tevent_req_nomem(bytes, req)) { + return tevent_req_post(req, ev); + } bytes = smb_bytes_push_str(bytes, smbXcli_conn_use_unicode(cli->conn), fname, strlen(fname)+1, &converted_len); + if (tevent_req_nomem(bytes, req)) { + return tevent_req_post(req, ev); + } if (clistr_is_previous_version_path(fname, NULL, NULL, NULL)) { additional_flags2 = FLAGS2_REPARSE_PATH;