summaryrefslogtreecommitdiff
path: root/source4/lib
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2009-07-06 09:24:18 +1000
committerAndrew Bartlett <abartlet@samba.org>2009-07-06 09:50:47 +1000
commitda45d5215d1da2a1ff1b72b9bc3f10ec2192fba9 (patch)
treea8455167957695c17ecb326534215987059b760d /source4/lib
parent880c286bc92db809553c5af2c4a26fe34d6a58dc (diff)
downloadsamba-da45d5215d1da2a1ff1b72b9bc3f10ec2192fba9.tar.gz
samba-da45d5215d1da2a1ff1b72b9bc3f10ec2192fba9.tar.bz2
samba-da45d5215d1da2a1ff1b72b9bc3f10ec2192fba9.zip
s4:ldb Fix talloc hirarchy in LDIF parsing code
The problem here was that some parts of the ldb_message were still attached to the ldb_ldif structure, and when only the message was taken (and the ldif free'ed to reclaim memory) we refereced free'ed memory. Andrew Bartlett
Diffstat (limited to 'source4/lib')
-rw-r--r--source4/lib/ldb/common/ldb_ldif.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/source4/lib/ldb/common/ldb_ldif.c b/source4/lib/ldb/common/ldb_ldif.c
index 400fb352ff..d64a9f1c3a 100644
--- a/source4/lib/ldb/common/ldb_ldif.c
+++ b/source4/lib/ldb/common/ldb_ldif.c
@@ -632,7 +632,7 @@ struct ldb_ldif *ldb_ldif_read(struct ldb_context *ldb,
if (!el->values) {
goto failed;
}
- ret = a->syntax->ldif_read_fn(ldb, ldif, &value, &el->values[el->num_values]);
+ ret = a->syntax->ldif_read_fn(ldb, el->values, &value, &el->values[el->num_values]);
if (ret != 0) {
goto failed;
}
@@ -647,7 +647,7 @@ struct ldb_ldif *ldb_ldif_read(struct ldb_context *ldb,
el->num_values++;
} else {
/* its a new attribute */
- msg->elements = talloc_realloc(ldif, msg->elements,
+ msg->elements = talloc_realloc(msg, msg->elements,
struct ldb_message_element,
msg->num_elements+1);
if (!msg->elements) {
@@ -661,7 +661,7 @@ struct ldb_ldif *ldb_ldif_read(struct ldb_context *ldb,
goto failed;
}
el->num_values = 1;
- ret = a->syntax->ldif_read_fn(ldb, ldif, &value, &el->values[0]);
+ ret = a->syntax->ldif_read_fn(ldb, el->values, &value, &el->values[0]);
if (ret != 0) {
goto failed;
}