From: Andrew Tridgell Date: Fri, 23 Oct 2009 03:54:07 +0000 (+1100) Subject: s4-samdb: make sure the static credentials are never freed X-Git-Tag: tdb-1.2.0~502 X-Git-Url: http://git.samba.org/samba.git/?p=ira%2Fwip.git;a=commitdiff_plain;h=0b624d9effa950e1e7ba95866a37b84bb74be772;hp=890e7719cf679108e7a74a660f20a40a32d7d552 s4-samdb: make sure the static credentials are never freed --- diff --git a/source4/dsdb/samdb/samdb.c b/source4/dsdb/samdb/samdb.c index c56782bb497..70f0409c3d9 100644 --- a/source4/dsdb/samdb/samdb.c +++ b/source4/dsdb/samdb/samdb.c @@ -72,6 +72,14 @@ char *samdb_relative_path(struct ldb_context *ldb, return full_name; } +/* + make sure the static credentials are not freed + */ +static int samdb_credentials_destructor(struct cli_credentials *creds) +{ + return -1; +} + /* this returns a static set of system credentials. It is static so that we always get the same pointer in ldb_wrap_connect() @@ -104,6 +112,7 @@ struct cli_credentials *samdb_credentials(struct tevent_context *event_ctx, return NULL; } static_credentials = cred; + talloc_set_destructor(cred, samdb_credentials_destructor); return cred; }