]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
Avoid memory leak on error path in crypto_cipher_init()
authorJouni Malinen <j@w1.fi>
Sat, 7 Feb 2009 10:07:06 +0000 (12:07 +0200)
committerJouni Malinen <j@w1.fi>
Sat, 7 Feb 2009 10:07:06 +0000 (12:07 +0200)
src/crypto/crypto_openssl.c

index e02af65c241348852686a6842e60c7101b9ee4c7..a4c3415c4d18bc89053f8a70413a5a2c65099711 100644 (file)
@@ -283,6 +283,7 @@ struct crypto_cipher * crypto_cipher_init(enum crypto_cipher_alg alg,
                        cipher = EVP_aes_256_cbc();
                        break;
                default:
+                       os_free(ctx);
                        return NULL;
                }
                break;
@@ -301,6 +302,7 @@ struct crypto_cipher * crypto_cipher_init(enum crypto_cipher_alg alg,
                break;
 #endif /* OPENSSL_NO_RC2 */
        default:
+               os_free(ctx);
                return NULL;
        }