From: Howard Chu Date: Sat, 7 Sep 2013 15:58:25 +0000 (-0700) Subject: Fix double-free on ciphersuite parse failure X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=cb00bb02181f4929fca34436f8f9e4a181667ac2;p=openldap Fix double-free on ciphersuite parse failure GnuTLS does an implicit free on failure. --- 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;