X-Git-Url: https://git.kernel.dk/?p=fio.git;a=blobdiff_plain;f=smalloc.c;h=1ba9353518813179fd3e277ae2cbeeec20a43129;hp=5fe0b6f7e57d11cdade9f103d9e8ff9dd5cbf7c1;hb=544992f770de2b98481b980e463e0492c2f2763e;hpb=8a1db9a16e1075498e5d6166fa46b419cecd8af8 diff --git a/smalloc.c b/smalloc.c index 5fe0b6f7..1ba93535 100644 --- a/smalloc.c +++ b/smalloc.c @@ -479,6 +479,17 @@ out: return NULL; } +void *scalloc(size_t nmemb, size_t size) +{ + void *ret; + + ret = smalloc(nmemb * size); + if (ret) + memset(ret, 0, nmemb * size); + + return ret; +} + char *smalloc_strdup(const char *str) { char *ptr;