From 717ceeeafcdad93c374a42dcdce040bc08e4a7a7 Mon Sep 17 00:00:00 2001 From: Simo Sorce Date: Thu, 9 Oct 2008 12:46:02 -0400 Subject: Fix memory handling problem, stuff was allocated on the wrong memory context, causing it to be freed ahead of time --- server/nss/nsssrv_ldb.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'server/nss') diff --git a/server/nss/nsssrv_ldb.c b/server/nss/nsssrv_ldb.c index 86e037091..023d63bea 100644 --- a/server/nss/nsssrv_ldb.c +++ b/server/nss/nsssrv_ldb.c @@ -68,16 +68,16 @@ static int getpw_callback(struct ldb_request *req, switch (ares->type) { case LDB_REPLY_ENTRY: - sctx->res->msgs = talloc_realloc(sctx, res->msgs, - struct ldb_message *, - res->count + 2); - if (! res->msgs) { + res->msgs = talloc_realloc(res, res->msgs, + struct ldb_message *, + res->count + 2); + if (!res->msgs) { return request_error(sctx, LDB_ERR_OPERATIONS_ERROR); } res->msgs[res->count + 1] = NULL; - res->msgs[res->count] = talloc_move(res->msgs, &ares->message); + res->msgs[res->count] = talloc_steal(res->msgs, ares->message); res->count++; break; @@ -93,12 +93,12 @@ static int getpw_callback(struct ldb_request *req, return request_error(sctx, LDB_ERR_OPERATIONS_ERROR); } - res->refs[n] = talloc_move(res->refs, &ares->referral); + res->refs[n] = talloc_steal(res->refs, ares->referral); res->refs[n + 1] = NULL; break; case LDB_REPLY_DONE: - res->controls = talloc_move(res, &ares->controls); + res->controls = talloc_steal(res, ares->controls); /* this is the last message, and means the request is done */ return request_done(sctx); -- cgit