]> 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)
committerHoward Chu <hyc@openldap.org>
Sat, 7 Sep 2013 15:58:25 +0000 (08:58 -0700)
GnuTLS does an implicit free on failure.

libraries/libldap/tls_g.c

index 60e592f2f2997ec1cd27367de84237035eff76cd..4cfc32b25eb70cb6e2352bfa8fc5a94f5655d3a9 100644 (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;