1
0
mirror of https://github.com/samba-team/samba.git synced 2025-11-14 12:23:52 +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 commit is contained in:
Andrew Tridgell
2004-09-27 01:36:19 +00:00
committed by Gerald (Jerry) Carter
parent d78eea9eb8
commit 8dc23821c9
30 changed files with 84 additions and 79 deletions

View File

@@ -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;
}