Fix double-free on ciphersuite parse failure

GnuTLS does an implicit free on failure.
This commit is contained in:
Howard Chu 2013-09-07 08:58:25 -07:00
parent 0480aec04e
commit cb00bb0218

View File

@ -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;