RT2943: Check sizes if -iv and -K arguments
[openssl.git] / apps / dhparam.c
index 6e51c0b82e78fb99a9d03bea74c2fa1a81032be9..c66c5916cf9748a0eb5bada7e489c96394c2743c 100644 (file)
@@ -379,11 +379,7 @@ int dhparam_main(int argc, char **argv)
 
         len = BN_num_bytes(dh->p);
         bits = BN_num_bits(dh->p);
-        data = (unsigned char *)OPENSSL_malloc(len);
-        if (data == NULL) {
-            perror("OPENSSL_malloc");
-            goto end;
-        }
+        data = app_malloc(len, "print a BN");
         BIO_printf(out, "#ifndef HEADER_DH_H\n"
                         "# include <openssl/dh.h>\n"
                         "#endif\n"