summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSimo Sorce <idra@samba.org>2008-10-09 12:46:02 -0400
committerSimo Sorce <idra@samba.org>2008-10-09 12:46:02 -0400
commit717ceeeafcdad93c374a42dcdce040bc08e4a7a7 (patch)
treeaded853002899b4059a460d55bfbc98a6c810deb
parentf9e85b312049affb38a180d29c69d36ac0ac4048 (diff)
downloadsssd-717ceeeafcdad93c374a42dcdce040bc08e4a7a7.tar.gz
sssd-717ceeeafcdad93c374a42dcdce040bc08e4a7a7.tar.xz
sssd-717ceeeafcdad93c374a42dcdce040bc08e4a7a7.zip
Fix memory handling problem, stuff was allocated on the wrong memory context,
causing it to be freed ahead of time
-rw-r--r--server/nss/nsssrv_ldb.c14
1 files changed, 7 insertions, 7 deletions
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);