From cb00bb02181f4929fca34436f8f9e4a181667ac2 Mon Sep 17 00:00:00 2001 From: Howard Chu Date: Sat, 7 Sep 2013 08:58:25 -0700 Subject: [PATCH] Fix double-free on ciphersuite parse failure GnuTLS does an implicit free on failure. --- libraries/libldap/tls_g.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/libraries/libldap/tls_g.c b/libraries/libldap/tls_g.c index 60e592f2f2..4cfc32b25e 100644 --- a/libraries/libldap/tls_g.c +++ b/libraries/libldap/tls_g.c @@ -794,7 +794,10 @@ tlsg_parse_ciphers( tlsg_ctx *ctx, char *suites ) { #ifdef HAVE_CIPHERSUITES const char *err; - return gnutls_priority_init( &ctx->prios, suites, &err ); + int rc = gnutls_priority_init( &ctx->prios, suites, &err ); + if ( rc ) + ctx->prios = NULL; + return rc; #else char *ptr, *end; int i, j, len, num; -- 2.39.5