mirror of
https://github.com/samba-team/samba.git
synced 2024-12-24 21:34:56 +03:00
Fix some C++ warnings
This commit is contained in:
parent
edce7bd7a9
commit
156c7f10bb
@ -1478,7 +1478,7 @@ int cli_ctemp(struct cli_state *cli, const char *path, char **tmp_path)
|
||||
if (len <= 0 || len > PATH_MAX) return -1;
|
||||
|
||||
if (tmp_path) {
|
||||
char *path2 = SMB_MALLOC(len+1);
|
||||
char *path2 = SMB_MALLOC_ARRAY(char, len+1);
|
||||
if (!path2) {
|
||||
return -1;
|
||||
}
|
||||
|
@ -355,18 +355,16 @@ static Eventlog_entry *get_eventlog_record(prs_struct *ps,
|
||||
into it's 2nd argment for 'B' */
|
||||
|
||||
if (wpcomputer) {
|
||||
ee->data_record.computer_name = TALLOC_MEMDUP(ee,
|
||||
wpcomputer,
|
||||
ee->data_record.computer_name_len);
|
||||
ee->data_record.computer_name = (smb_ucs2_t *)TALLOC_MEMDUP(
|
||||
ee, wpcomputer, ee->data_record.computer_name_len);
|
||||
if (!ee->data_record.computer_name) {
|
||||
TALLOC_FREE(ee);
|
||||
goto out;
|
||||
}
|
||||
}
|
||||
if (wpsource) {
|
||||
ee->data_record.source_name = TALLOC_MEMDUP(ee,
|
||||
wpsource,
|
||||
ee->data_record.source_name_len);
|
||||
ee->data_record.source_name = (smb_ucs2_t *)TALLOC_MEMDUP(
|
||||
ee, wpsource, ee->data_record.source_name_len);
|
||||
if (!ee->data_record.source_name) {
|
||||
TALLOC_FREE(ee);
|
||||
goto out;
|
||||
@ -374,18 +372,16 @@ static Eventlog_entry *get_eventlog_record(prs_struct *ps,
|
||||
}
|
||||
|
||||
if (wpsid) {
|
||||
ee->data_record.sid = TALLOC_MEMDUP(ee,
|
||||
wpsid,
|
||||
ee->record.user_sid_length);
|
||||
ee->data_record.sid = (smb_ucs2_t *)TALLOC_MEMDUP(
|
||||
ee, wpsid, ee->record.user_sid_length);
|
||||
if (!ee->data_record.sid) {
|
||||
TALLOC_FREE(ee);
|
||||
goto out;
|
||||
}
|
||||
}
|
||||
if (wpstrs) {
|
||||
ee->data_record.strings = TALLOC_MEMDUP(ee,
|
||||
wpstrs,
|
||||
ee->data_record.strings_len);
|
||||
ee->data_record.strings = (smb_ucs2_t *)TALLOC_MEMDUP(
|
||||
ee, wpstrs, ee->data_record.strings_len);
|
||||
if (!ee->data_record.strings) {
|
||||
TALLOC_FREE(ee);
|
||||
goto out;
|
||||
@ -393,9 +389,8 @@ static Eventlog_entry *get_eventlog_record(prs_struct *ps,
|
||||
}
|
||||
|
||||
if (puserdata) {
|
||||
ee->data_record.user_data = TALLOC_MEMDUP(ee,
|
||||
puserdata,
|
||||
ee->data_record.user_data_len);
|
||||
ee->data_record.user_data = (char *)TALLOC_MEMDUP(
|
||||
ee, puserdata, ee->data_record.user_data_len);
|
||||
if (!ee->data_record.user_data) {
|
||||
TALLOC_FREE(ee);
|
||||
goto out;
|
||||
|
Loading…
Reference in New Issue
Block a user