smalloc: smalloc() already clears memory, scalloc() need not do it again
authorJens Axboe <axboe@fb.com>
Fri, 3 Jul 2015 17:47:10 +0000 (11:47 -0600)
committerJens Axboe <axboe@fb.com>
Fri, 3 Jul 2015 17:47:10 +0000 (11:47 -0600)
Signed-off-by: Jens Axboe <axboe@fb.com>
smalloc.c

index 6bf66fcf58013db6e318d69c62b87dc68fb3357f..8412e7518464d6dbe3e7f218e33e47e855e8e26f 100644 (file)
--- a/smalloc.c
+++ b/smalloc.c
@@ -492,13 +492,7 @@ void *smalloc(size_t size)
 
 void *scalloc(size_t nmemb, size_t size)
 {
-       void *ret;
-
-       ret = smalloc(nmemb * size);
-       if (ret)
-               memset(ret, 0, nmemb * size);
-
-       return ret;
+       return smalloc(nmemb * size);
 }
 
 char *smalloc_strdup(const char *str)