From 45b7b713a3aadec896ed1bd1bdef1a941b1abc1b Mon Sep 17 00:00:00 2001 From: Andrew Kroeger Date: Thu, 10 Sep 2009 10:04:47 -0500 Subject: s4:ldb_map: Don't free ares too early. As found when running "make test" with the MALLOC_CHECK_ and MALLOC_PERTURB_ environment variables set. --- source4/lib/ldb/ldb_map/ldb_map_outbound.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'source4') diff --git a/source4/lib/ldb/ldb_map/ldb_map_outbound.c b/source4/lib/ldb/ldb_map/ldb_map_outbound.c index 4487d7e763..5f5be89976 100644 --- a/source4/lib/ldb/ldb_map/ldb_map_outbound.c +++ b/source4/lib/ldb/ldb_map/ldb_map_outbound.c @@ -1250,15 +1250,15 @@ static int map_remote_search_callback(struct ldb_request *req, ares->response, LDB_SUCCESS); } - talloc_free(ares); - /* reset the pointer to the start of the list */ ac->r_current = ac->r_list; /* no entry just return */ if (ac->r_current == NULL) { - return ldb_module_done(ac->req, ares->controls, + ret = ldb_module_done(ac->req, ares->controls, ares->response, LDB_SUCCESS); + talloc_free(ares); + return ret; } ret = map_search_local(ac); -- cgit