summaryrefslogtreecommitdiff
path: root/source4/lib/ldb
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2006-10-16 11:03:48 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 14:21:10 -0500
commit64eed1e78e302b8fc71133e115f41f2c7b52b91b (patch)
tree761484e6d20a447859b070524f953f23be84e725 /source4/lib/ldb
parent915c281deb99621a83ac42ffaf913ca20fa5dd65 (diff)
downloadsamba-64eed1e78e302b8fc71133e115f41f2c7b52b91b.tar.gz
samba-64eed1e78e302b8fc71133e115f41f2c7b52b91b.tar.bz2
samba-64eed1e78e302b8fc71133e115f41f2c7b52b91b.zip
r19327: fixed a leak in ldif_canonicalise_objectCategory()
(This used to be commit 5cc92d915b7442d2eebc4b66ab89bbd15b96a493)
Diffstat (limited to 'source4/lib/ldb')
-rw-r--r--source4/lib/ldb/samba/ldif_handlers.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/source4/lib/ldb/samba/ldif_handlers.c b/source4/lib/ldb/samba/ldif_handlers.c
index b490c8f005..46eac2295d 100644
--- a/source4/lib/ldb/samba/ldif_handlers.c
+++ b/source4/lib/ldb/samba/ldif_handlers.c
@@ -296,7 +296,7 @@ static int ldif_canonicalise_objectCategory(struct ldb_context *ldb, void *mem_c
const struct ldb_val *in, struct ldb_val *out)
{
struct ldb_dn *dn1 = NULL;
- char *oc1;
+ char *oc1, *oc2;
dn1 = ldb_dn_explode(mem_ctx, (char *)in->data);
if (dn1 == NULL) {
@@ -308,9 +308,11 @@ static int ldif_canonicalise_objectCategory(struct ldb_context *ldb, void *mem_c
return -1;
}
- oc1 = ldb_casefold(ldb, mem_ctx, oc1);
- out->data = (void *)oc1;
- out->length = strlen(oc1);
+ oc2 = ldb_casefold(ldb, mem_ctx, oc1);
+ out->data = (void *)oc2;
+ out->length = strlen(oc2);
+ talloc_free(oc1);
+ talloc_free(dn1);
return 0;
}