free cleanup almost the finale
[openssl.git] / crypto / rand / rand_lib.c
index 2f4dc09155b6de35a56a7133748660d492fd314f..acc116b9a7a419c752106da9be38a41edeb06565 100644 (file)
@@ -159,6 +159,7 @@ int RAND_bytes(unsigned char *buf, int num)
     return (-1);
 }
 
+#ifndef OPENSSL_NO_DEPRECATED
 int RAND_pseudo_bytes(unsigned char *buf, int num)
 {
     const RAND_METHOD *meth = RAND_get_rand_method();
@@ -166,6 +167,7 @@ int RAND_pseudo_bytes(unsigned char *buf, int num)
         return meth->pseudorand(buf, num);
     return (-1);
 }
+#endif
 
 int RAND_status(void)
 {
@@ -205,10 +207,7 @@ static size_t drbg_get_entropy(DRBG_CTX *ctx, unsigned char **pout,
 
 static void drbg_free_entropy(DRBG_CTX *ctx, unsigned char *out, size_t olen)
 {
-    if (out) {
-        OPENSSL_cleanse(out, olen);
-        OPENSSL_free(out);
-    }
+    OPENSSL_clear_free(out, olen);
 }
 
 /*