From 7b22b22202698e64eecbd3475144fabcf32ffcde Mon Sep 17 00:00:00 2001 From: Hallvard Furuseth Date: Fri, 30 Oct 2009 17:08:57 +0000 Subject: [PATCH] ITS#6355: Fix uninitialiezed lso_tmp_rsa_cb() return value --- libraries/libldap/tls_o.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/libraries/libldap/tls_o.c b/libraries/libldap/tls_o.c index 4d08272a21..dcae8f2894 100644 --- a/libraries/libldap/tls_o.c +++ b/libraries/libldap/tls_o.c @@ -1081,6 +1081,7 @@ tlso_tmp_rsa_cb( SSL *ssl, int is_export, int key_length ) /* FIXME: Who frees the key? */ #if OPENSSL_VERSION_NUMBER > 0x00908000 BIGNUM *bn = BN_new(); + tmp_rsa = NULL; if ( bn ) { if ( BN_set_word( bn, RSA_F4 )) { tmp_rsa = RSA_new(); @@ -1090,8 +1091,6 @@ tlso_tmp_rsa_cb( SSL *ssl, int is_export, int key_length ) } } BN_free( bn ); - } else { - tmp_rsa = NULL; } #else tmp_rsa = RSA_generate_key( key_length, RSA_F4, NULL, NULL ); @@ -1101,7 +1100,6 @@ tlso_tmp_rsa_cb( SSL *ssl, int is_export, int key_length ) Debug( LDAP_DEBUG_ANY, "TLS: Failed to generate temporary %d-bit %s RSA key\n", key_length, is_export ? "export" : "domestic", 0 ); - return NULL; } return tmp_rsa; } -- 2.39.5