git.samba.org
/
nivanova
/
samba-autobuild
/
.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
1179890
)
Try to avoid a memory leak if we re-set the global schema
author
Andrew Bartlett
<abartlet@samba.org>
Fri, 25 Jul 2008 01:58:24 +0000
(11:58 +1000)
committer
Andrew Bartlett
<abartlet@samba.org>
Fri, 25 Jul 2008 01:58:24 +0000
(11:58 +1000)
However, try also not to pull a schema out from under a running ldb
session.
Andrew Bartlett
(This used to be commit
7cf9b9dd0bb35835a7c6e9897ea99951a33c63c7
)
source4/dsdb/schema/schema_init.c
patch
|
blob
|
history
diff --git
a/source4/dsdb/schema/schema_init.c
b/source4/dsdb/schema/schema_init.c
index 71d952b944bbaa926fd4aaab9fccb3a89246cc8c..75457b4bea0be909cf374767e198bde8f1ff8ec4 100644
(file)
--- a/
source4/dsdb/schema/schema_init.c
+++ b/
source4/dsdb/schema/schema_init.c
@@
-1534,6
+1534,11
@@
int dsdb_set_global_schema(struct ldb_context *ldb)
return ret;
}
+ /* Keep a reference to this schema, just incase the global copy is replaced */
+ if (talloc_reference(ldb, global_schema) == NULL) {
+ return LDB_ERR_OPERATIONS_ERROR;
+ }
+
return LDB_SUCCESS;
}
@@
-1571,6
+1576,10
@@
void dsdb_make_schema_global(struct ldb_context *ldb)
return;
}
+ if (global_schema) {
+ talloc_unlink(talloc_autofree_context(), schema);
+ }
+
talloc_steal(talloc_autofree_context(), schema);
global_schema = schema;