Check malloc failure via app_malloc
authorRich Salz <rsalz@openssl.org>
Mon, 21 May 2018 14:28:16 +0000 (10:28 -0400)
committerRich Salz <rsalz@openssl.org>
Mon, 21 May 2018 14:28:16 +0000 (10:28 -0400)
Thanks to GitHUb user murugesandins for reporting this.

Reviewed-by: Matt Caswell <matt@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/6322)

apps/speed.c

index c0a34ee9948b2f7e9ccfcf45295daa9db936e3a5..e5132631cf7416b082ced9f81e1e7accf6b37c7b 100644 (file)
@@ -3152,7 +3152,7 @@ static int do_multi(int multi, int size_num)
     int *fds;
     static char sep[] = ":";
 
-    fds = malloc(sizeof(*fds) * multi);
+    fds = app_malloc(sizeof(*fds) * multi, "fd buffer for do_multi");
     for (n = 0; n < multi; ++n) {
         if (pipe(fd) == -1) {
             BIO_printf(bio_err, "pipe failure\n");