mirror of
https://github.com/samba-team/samba.git
synced 2025-01-11 05:18:09 +03:00
s3:libsmb: always use the tevent_req_nomem() for checking allocation failures
This will also make sure we cleanup 'req' in case of an error. metze
This commit is contained in:
parent
7a0a134e0c
commit
14bbed1d67
@ -622,8 +622,8 @@ struct tevent_req *cli_mkdir_send(TALLOC_CTX *mem_ctx,
|
||||
}
|
||||
|
||||
bytes = talloc_array(state, uint8_t, 1);
|
||||
if (!bytes) {
|
||||
return NULL;
|
||||
if (tevent_req_nomem(bytes, req)) {
|
||||
return tevent_req_post(req, ev);
|
||||
}
|
||||
bytes[0] = 4;
|
||||
bytes = smb_bytes_push_str(bytes, cli_ucs2(cli), dname,
|
||||
@ -634,7 +634,7 @@ struct tevent_req *cli_mkdir_send(TALLOC_CTX *mem_ctx,
|
||||
}
|
||||
|
||||
subreq = cli_smb_send(state, ev, cli, SMBmkdir, additional_flags,
|
||||
0, NULL, talloc_get_size(bytes), bytes);
|
||||
0, NULL, talloc_get_size(bytes), bytes);
|
||||
if (tevent_req_nomem(subreq, req)) {
|
||||
return tevent_req_post(req, ev);
|
||||
}
|
||||
@ -730,8 +730,8 @@ struct tevent_req *cli_rmdir_send(TALLOC_CTX *mem_ctx,
|
||||
}
|
||||
|
||||
bytes = talloc_array(state, uint8_t, 1);
|
||||
if (!bytes) {
|
||||
return NULL;
|
||||
if (tevent_req_nomem(bytes, req)) {
|
||||
return tevent_req_post(req, ev);
|
||||
}
|
||||
bytes[0] = 4;
|
||||
bytes = smb_bytes_push_str(bytes, cli_ucs2(cli), dname,
|
||||
@ -742,7 +742,7 @@ struct tevent_req *cli_rmdir_send(TALLOC_CTX *mem_ctx,
|
||||
}
|
||||
|
||||
subreq = cli_smb_send(state, ev, cli, SMBrmdir, additional_flags,
|
||||
0, NULL, talloc_get_size(bytes), bytes);
|
||||
0, NULL, talloc_get_size(bytes), bytes);
|
||||
if (tevent_req_nomem(subreq, req)) {
|
||||
return tevent_req_post(req, ev);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user