diff options
Diffstat (limited to 'source4/libcli/raw')
-rw-r--r-- | source4/libcli/raw/raweas.c | 2 | ||||
-rw-r--r-- | source4/libcli/raw/rawfileinfo.c | 6 | ||||
-rw-r--r-- | source4/libcli/raw/rawrequest.c | 4 |
3 files changed, 7 insertions, 5 deletions
diff --git a/source4/libcli/raw/raweas.c b/source4/libcli/raw/raweas.c index d78f10fe1a..e07fbcd288 100644 --- a/source4/libcli/raw/raweas.c +++ b/source4/libcli/raw/raweas.c @@ -128,7 +128,7 @@ NTSTATUS ea_pull_list(const DATA_BLOB *blob, blob2.data = blob->data + ofs; blob2.length = ea_size - ofs; - *eas = talloc_realloc(*eas, sizeof(**eas) * (n+1)); + *eas = talloc_realloc(mem_ctx, *eas, sizeof(**eas) * (n+1)); if (! *eas) return NT_STATUS_NO_MEMORY; len = ea_pull_struct(&blob2, mem_ctx, &(*eas)[n]); diff --git a/source4/libcli/raw/rawfileinfo.c b/source4/libcli/raw/rawfileinfo.c index aac8f2657b..cbb666b7ce 100644 --- a/source4/libcli/raw/rawfileinfo.c +++ b/source4/libcli/raw/rawfileinfo.c @@ -174,8 +174,10 @@ static NTSTATUS smb_raw_info_backend(struct smbcli_session *session, while (blob->length - ofs >= 24) { uint_t n = parms->stream_info.out.num_streams; parms->stream_info.out.streams = - talloc_realloc(parms->stream_info.out.streams, - (n+1) * sizeof(parms->stream_info.out.streams[0])); + talloc_realloc_p(mem_ctx, + parms->stream_info.out.streams, + struct stream_struct, + n+1); if (!parms->stream_info.out.streams) { return NT_STATUS_NO_MEMORY; } diff --git a/source4/libcli/raw/rawrequest.c b/source4/libcli/raw/rawrequest.c index a94e796628..a15d681a5c 100644 --- a/source4/libcli/raw/rawrequest.c +++ b/source4/libcli/raw/rawrequest.c @@ -213,7 +213,7 @@ static void smbcli_req_grow_allocation(struct smbcli_request *req, uint_t new_si /* we need to realloc */ req->out.allocated = req->out.size + delta + REQ_OVER_ALLOCATION; - buf2 = talloc_realloc(req->out.buffer, req->out.allocated); + buf2 = talloc_realloc(req, req->out.buffer, req->out.allocated); if (buf2 == NULL) { smb_panic("out of memory in req_grow_allocation"); } @@ -911,7 +911,7 @@ size_t smbcli_blob_append_string(struct smbcli_session *session, max_len = (strlen(str)+2) * MAX_BYTES_PER_CHAR; - blob->data = talloc_realloc(blob->data, blob->length + max_len); + blob->data = talloc_realloc(mem_ctx, blob->data, blob->length + max_len); if (!blob->data) { return 0; } |