mirror of
https://github.com/samba-team/samba.git
synced 2024-12-23 17:34:34 +03:00
Move to talloc from malloc.
This commit is contained in:
parent
e735b52254
commit
049375ec51
@ -4185,7 +4185,9 @@ static NTSTATUS cli_set_ea(struct cli_state *cli, uint16_t setup_val,
|
||||
|
||||
if (ea_namelen == 0 && ea_len == 0) {
|
||||
data_len = 4;
|
||||
data = (uint8_t *)SMB_MALLOC(data_len);
|
||||
data = talloc_array(talloc_tos(),
|
||||
uint8_t,
|
||||
data_len);
|
||||
if (!data) {
|
||||
return NT_STATUS_NO_MEMORY;
|
||||
}
|
||||
@ -4193,7 +4195,9 @@ static NTSTATUS cli_set_ea(struct cli_state *cli, uint16_t setup_val,
|
||||
SIVAL(p,0,data_len);
|
||||
} else {
|
||||
data_len = 4 + 4 + ea_namelen + 1 + ea_len;
|
||||
data = (uint8_t *)SMB_MALLOC(data_len);
|
||||
data = talloc_array(talloc_tos(),
|
||||
uint8_t,
|
||||
data_len);
|
||||
if (!data) {
|
||||
return NT_STATUS_NO_MEMORY;
|
||||
}
|
||||
@ -4215,7 +4219,7 @@ static NTSTATUS cli_set_ea(struct cli_state *cli, uint16_t setup_val,
|
||||
NULL, 0, NULL, /* rsetup */
|
||||
NULL, 0, NULL, /* rparam */
|
||||
NULL, 0, NULL); /* rdata */
|
||||
SAFE_FREE(data);
|
||||
talloc_free(data);
|
||||
return status;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user