]> git.sur5r.net Git - openldap/commitdiff
Fix double-free on ciphersuite parse failure
authorHoward Chu <hyc@openldap.org>
Sat, 7 Sep 2013 15:58:25 +0000 (08:58 -0700)
committerQuanah Gibson-Mount <quanah@openldap.org>
Wed, 9 Apr 2014 02:09:12 +0000 (21:09 -0500)
GnuTLS does an implicit free on failure.

libraries/libldap/tls_g.c

index 50e27a6b681093effea82f37995af8022f3676b5..c1e368e02eb0c21a3dbde2d8efe5a38ed111790f 100644 (file)
@@ -786,7 +786,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;