Removed ugly size_t less than zero check.
authorHikar <hikar@davelog.net>
Sat, 18 Feb 2017 07:44:49 +0000 (08:44 +0100)
committerRich Salz <rsalz@openssl.org>
Tue, 21 Feb 2017 17:31:45 +0000 (12:31 -0500)
CLA: trivial.

Reviewed-by: Richard Levitte <levitte@openssl.org>
Reviewed-by: Rich Salz <rsalz@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/2674)

(cherry picked from commit 5e1f879ab5a2bfdf2d58222f965f93fe1b511ce7)

crypto/mem.c

index 02aa43a7ef52bbd3cd1525312c874c60c4ef4e40..bc35132fc7b45b735dea342ab6fd9eb10a538221 100644 (file)
@@ -75,7 +75,7 @@ void *CRYPTO_malloc(size_t num, const char *file, int line)
     if (malloc_impl != NULL && malloc_impl != CRYPTO_malloc)
         return malloc_impl(num, file, line);
 
-    if (num <= 0)
+    if (num == 0)
         return NULL;
 
     allow_customize = 0;