mirror of
https://github.com/vanhoefm/fragattacks.git
synced 2024-11-25 16:58:41 -05:00
Avoid memory leak on error path in crypto_cipher_init()
This commit is contained in:
parent
23a139246d
commit
7818ad2c8f
@ -283,6 +283,7 @@ struct crypto_cipher * crypto_cipher_init(enum crypto_cipher_alg alg,
|
|||||||
cipher = EVP_aes_256_cbc();
|
cipher = EVP_aes_256_cbc();
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
|
os_free(ctx);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@ -301,6 +302,7 @@ struct crypto_cipher * crypto_cipher_init(enum crypto_cipher_alg alg,
|
|||||||
break;
|
break;
|
||||||
#endif /* OPENSSL_NO_RC2 */
|
#endif /* OPENSSL_NO_RC2 */
|
||||||
default:
|
default:
|
||||||
|
os_free(ctx);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user