summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJakub Hrozek <jhrozek@redhat.com>2011-05-03 17:51:30 +0200
committerStephen Gallagher <sgallagh@redhat.com>2011-05-04 10:14:40 -0400
commitda6e845672e9ab68a32946a734c4ba8ce2cc1fc0 (patch)
tree6d526a4a2b0db9cf25442ced50433cac7dfb754f
parent67dabadee5686649814bf4f76d15904bb7267d38 (diff)
downloadsssd-da6e845672e9ab68a32946a734c4ba8ce2cc1fc0.tar.gz
sssd-da6e845672e9ab68a32946a734c4ba8ce2cc1fc0.tar.xz
sssd-da6e845672e9ab68a32946a734c4ba8ce2cc1fc0.zip
Do not leak pcre context
-rw-r--r--src/providers/krb5/krb5_init.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/providers/krb5/krb5_init.c b/src/providers/krb5/krb5_init.c
index 525ba4dfc..6176dd187 100644
--- a/src/providers/krb5/krb5_init.c
+++ b/src/providers/krb5/krb5_init.c
@@ -42,6 +42,17 @@ struct bet_ops krb5_auth_ops = {
.finalize = NULL,
};
+int krb5_ctx_re_destructor(void *memctx)
+{
+ struct krb5_ctx *ctx = (struct krb5_ctx *) memctx;
+
+ if (ctx->illegal_path_re) {
+ pcre_free(ctx->illegal_path_re);
+ ctx->illegal_path_re = NULL;
+ }
+ return 0;
+}
+
int sssm_krb5_auth_init(struct be_ctx *bectx,
struct bet_ops **ops,
void **pvt_auth_data)
@@ -183,6 +194,7 @@ int sssm_krb5_auth_init(struct be_ctx *bectx,
ret = EFAULT;
goto fail;
}
+ talloc_set_destructor((TALLOC_CTX *) ctx, krb5_ctx_re_destructor);
*ops = &krb5_auth_ops;
*pvt_auth_data = ctx;