From 69905bf968003216d444fc68d8597e139362f2e6 Mon Sep 17 00:00:00 2001 From: Stephen Gallagher Date: Wed, 27 Jun 2012 09:59:57 -0400 Subject: KRB5: Drop memctx parameter of krb5_try_kdcip This function is not supposed to return any newly-allocated memory directly. It was actually leaking the memory for krb5_servers if krb5_kdcip was being used, though it was undetectable because it was allocated on the provided memctx. This patch removes the memctx parameter and allocates krb5_servers temporarily on NULL and ensures that it is freed on all exit conditions. It is not necessary to retain this memory, as dp_opt_set_string() performs a talloc_strdup onto the appropriate context internally. It also updates the DEBUG messages for this function to the appropriate new macro levels. --- src/providers/krb5/krb5_common.h | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'src/providers/krb5/krb5_common.h') diff --git a/src/providers/krb5/krb5_common.h b/src/providers/krb5/krb5_common.h index 029ebf6ed..ec4fc0509 100644 --- a/src/providers/krb5/krb5_common.h +++ b/src/providers/krb5/krb5_common.h @@ -137,9 +137,8 @@ errno_t check_and_export_options(struct dp_option *opts, struct sss_domain_info *dom, struct krb5_ctx *krb5_ctx); -errno_t krb5_try_kdcip(TALLOC_CTX *memctx, struct confdb_ctx *cdb, - const char *conf_path, struct dp_option *opts, - int opt_id); +errno_t krb5_try_kdcip(struct confdb_ctx *cdb, const char *conf_path, + struct dp_option *opts, int opt_id); errno_t krb5_get_options(TALLOC_CTX *memctx, struct confdb_ctx *cdb, const char *conf_path, struct dp_option **_opts); -- cgit