From 095c8b2078128838f6b830613e80cbdcf49e10cf Mon Sep 17 00:00:00 2001 From: Matthias Dieter Wallnöfer Date: Sat, 30 Oct 2010 19:56:24 +0200 Subject: s4:samldb LDB module - primary group change - free temporary messages to save memory --- source4/dsdb/samdb/ldb_modules/samldb.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'source4/dsdb/samdb/ldb_modules/samldb.c') diff --git a/source4/dsdb/samdb/ldb_modules/samldb.c b/source4/dsdb/samdb/ldb_modules/samldb.c index 44c8fee29f..b5e8187c78 100644 --- a/source4/dsdb/samdb/ldb_modules/samldb.c +++ b/source4/dsdb/samdb/ldb_modules/samldb.c @@ -1109,7 +1109,7 @@ static int samldb_prim_group_change(struct samldb_ctx *ac) } /* Remove the "member" attribute on the new primary group */ - msg = talloc_zero(ac, struct ldb_message); + msg = ldb_msg_new(ac->msg); if (msg == NULL) { return ldb_module_oom(ac->module); } @@ -1125,9 +1125,10 @@ static int samldb_prim_group_change(struct samldb_ctx *ac) if (ret != LDB_SUCCESS) { return ret; } + talloc_free(msg); /* Add a "member" attribute for the previous primary group */ - msg = talloc_zero(ac, struct ldb_message); + msg = ldb_msg_new(ac->msg); if (msg == NULL) { return ldb_module_oom(ac->module); } @@ -1143,6 +1144,7 @@ static int samldb_prim_group_change(struct samldb_ctx *ac) if (ret != LDB_SUCCESS) { return ret; } + talloc_free(msg); } talloc_free(res); -- cgit