From 52400f0f7d26727a59797e21c09a1433daf094e4 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Fri, 17 Jun 2005 02:46:25 +0000 Subject: r7666: fixed a memory leak in the ldap ldb backend (This used to be commit ac3f33c61555a2afa30fe446676013564982e257) --- source4/lib/ldb/ldb_ldap/ldb_ldap.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'source4/lib/ldb/ldb_ldap') diff --git a/source4/lib/ldb/ldb_ldap/ldb_ldap.c b/source4/lib/ldb/ldb_ldap/ldb_ldap.c index 828bcc5d61..16beed58f8 100644 --- a/source4/lib/ldb/ldb_ldap/ldb_ldap.c +++ b/source4/lib/ldb/ldb_ldap/ldb_ldap.c @@ -76,14 +76,13 @@ static int lldb_rename(struct ldb_module *module, const char *olddn, const char int ret = 0; char *newrdn, *p; const char *parentdn = ""; - TALLOC_CTX *mem_ctx = talloc_new(lldb); /* ignore ltdb specials */ if (olddn[0] == '@' ||newdn[0] == '@') { return 0; } - newrdn = talloc_strdup(mem_ctx, newdn); + newrdn = talloc_strdup(lldb, newdn); if (!newrdn) { return -1; } @@ -99,7 +98,7 @@ static int lldb_rename(struct ldb_module *module, const char *olddn, const char ret = -1; } - talloc_free(mem_ctx); + talloc_free(newrdn); return ret; } -- cgit