Sfoglia il codice sorgente

Always treat failure to allocate an RSA key as an unrecoverable allocation error

Nick Mathewson 14 anni fa
parent
commit
bfde636aad
2 ha cambiato i file con 4 aggiunte e 1 eliminazioni
  1. 3 0
      changes/bug2378
  2. 1 1
      src/common/crypto.c

+ 3 - 0
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.

+ 1 - 1
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);
 }