summaryrefslogtreecommitdiffstats
path: root/src/providers/ldap/ldap_child.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/providers/ldap/ldap_child.c')
-rw-r--r--src/providers/ldap/ldap_child.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/providers/ldap/ldap_child.c b/src/providers/ldap/ldap_child.c
index 069fbcfe1..6a78ca012 100644
--- a/src/providers/ldap/ldap_child.c
+++ b/src/providers/ldap/ldap_child.c
@@ -97,6 +97,11 @@ static int pack_buffer(struct response *r, int result, const char *msg)
len = strlen(msg);
r->size = 2 * sizeof(uint32_t) + len;
+ r->buf = talloc_array(r, uint8_t, r->size);
+ if(!r->buf) {
+ return ENOMEM;
+ }
+
/* result */
SAFEALIGN_SET_UINT32(&r->buf[p], result, &p);
@@ -265,12 +270,7 @@ static int prepare_response(TALLOC_CTX *mem_ctx,
r = talloc_zero(mem_ctx, struct response);
if (!r) return ENOMEM;
- r->buf = talloc_size(mem_ctx, MAX_CHILD_MSG_SIZE);
- if (r->buf == NULL) {
- DEBUG(1, ("talloc_size failed.\n"));
- return ENOMEM;
- }
- r->max_size = MAX_CHILD_MSG_SIZE;
+ r->buf = NULL;
r->size = 0;
if (kerr == 0) {