Explorar o código

* Properly cleanup ssl_ctx if unable to seed the PRNG

Bryan Drewery %!s(int64=15) %!d(string=hai) anos
pai
achega
f74104e1a9
Modificáronse 1 ficheiros con 2 adicións e 0 borrados
  1. 2 0
      src/libssl.c

+ 2 - 0
src/libssl.c

@@ -106,6 +106,8 @@ int load_ssl() {
 
 
   if (seed_PRNG()) {
   if (seed_PRNG()) {
     sdprintf("Wasn't able to properly seed the PRNG!");
     sdprintf("Wasn't able to properly seed the PRNG!");
+    SSL_CTX_free(ssl_ctx);
+    ssl_ctx = NULL;
     return 1;
     return 1;
   }
   }
 #endif
 #endif