mirror of
https://github.com/samba-team/samba.git
synced 2025-12-21 20:23:50 +03:00
r2671: we're getting too many errors caused by the talloc_realloc() API not
taking a context (so when you pass a NULL pointer you end up with
memory in a top level context). Fixed it by changing the API to take a
context. The context is only used if the pointer you are reallocing is
NULL.
(This used to be commit 8dc23821c9)
This commit is contained in:
committed by
Gerald (Jerry) Carter
parent
f095a8e748
commit
5b44130afa
@@ -184,7 +184,7 @@ static NTSTATUS ipv4_tcp_accept(struct socket_context *sock, struct socket_conte
|
||||
}
|
||||
|
||||
static NTSTATUS ipv4_tcp_recv(struct socket_context *sock, TALLOC_CTX *mem_ctx,
|
||||
DATA_BLOB *blob, size_t wantlen, uint32_t flags)
|
||||
DATA_BLOB *blob, size_t wantlen, uint32_t flags)
|
||||
{
|
||||
ssize_t gotlen;
|
||||
void *buf;
|
||||
@@ -235,7 +235,7 @@ static NTSTATUS ipv4_tcp_recv(struct socket_context *sock, TALLOC_CTX *mem_ctx,
|
||||
}
|
||||
|
||||
blob->length = gotlen;
|
||||
blob->data = talloc_realloc(buf, gotlen);
|
||||
blob->data = talloc_realloc(mem_ctx, buf, gotlen);
|
||||
if (!blob->data) {
|
||||
return NT_STATUS_NO_MEMORY;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user