summaryrefslogtreecommitdiff
path: root/source4
diff options
context:
space:
mode:
authorMatthias Dieter Wallnöfer <mdw@samba.org>2010-10-30 19:56:24 +0200
committerMatthias Dieter Wallnöfer <mdw@samba.org>2010-10-30 20:23:31 +0200
commit095c8b2078128838f6b830613e80cbdcf49e10cf (patch)
tree016c8f0d0d870b86b82013bb0f1a99f1a1926861 /source4
parentc0ebf5d7435c3c4968eefafc6c566dc818e600a0 (diff)
downloadsamba-095c8b2078128838f6b830613e80cbdcf49e10cf.tar.gz
samba-095c8b2078128838f6b830613e80cbdcf49e10cf.tar.bz2
samba-095c8b2078128838f6b830613e80cbdcf49e10cf.zip
s4:samldb LDB module - primary group change - free temporary messages to save memory
Diffstat (limited to 'source4')
-rw-r--r--source4/dsdb/samdb/ldb_modules/samldb.c6
1 files changed, 4 insertions, 2 deletions
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);