From: Nick Mathewson Date: Tue, 25 Jan 2011 23:19:09 +0000 (-0500) Subject: Always treat failure to allocate an RSA key as an unrecoverable allocation error X-Git-Tag: tor-0.2.2.23-alpha~11^2~15^2~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=bfde636aaddf22f68c090a76aa6387975a57c308;p=thirdparty%2Ftor.git Always treat failure to allocate an RSA key as an unrecoverable allocation error --- diff --git a/changes/bug2378 b/changes/bug2378 new file mode 100644 index 0000000000..a3ae196dc2 --- /dev/null +++ b/changes/bug2378 @@ -0,0 +1,3 @@ + o Minor code simplifications and refactorings + - Always treat failure to allocate an RSA key as an unrecoverable + allocation error. diff --git a/src/common/crypto.c b/src/common/crypto.c index 4223b10a7f..09d7fc886b 100644 --- a/src/common/crypto.c +++ b/src/common/crypto.c @@ -379,7 +379,7 @@ crypto_new_pk_env(void) RSA *rsa; rsa = RSA_new(); - if (!rsa) return NULL; + tor_assert(rsa); return _crypto_new_pk_env_rsa(rsa); }