From a213a371aeb2fae4df0f41e85faca2cfd38f6447 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Wed, 7 Sep 2022 11:12:08 -0700 Subject: [PATCH] s3: libsmb: Add missing memory allocation fail checks in cli_ntcreate1_send(). Signed-off-by: Jeremy Allison Reviewed-by: Noel Power --- source3/libsmb/clifile.c | 6 ++++++ 1 file changed, 6 insertions(+) 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; -- 2.47.3