X-Git-Url: https://wimlib.net/git/?a=blobdiff_plain;ds=sidebyside;f=src%2Futil.c;h=6b93e2a93bab0daf16e0c20c990fa871d7b005c7;hb=f5d26d6005ba759762bec8c7cd45a738e577a8a7;hp=a0ed84d95014760cff7f0b95618c1fcb78c1d943;hpb=5dea227530b479ee9436b8eb46df3ec3ba009c0d;p=wimlib diff --git a/src/util.c b/src/util.c index a0ed84d9..6b93e2a9 100644 --- a/src/util.c +++ b/src/util.c @@ -439,7 +439,7 @@ void * wimlib_calloc(size_t nmemb, size_t size) { size_t total_size = nmemb * size; - void *p = (*wimlib_malloc_func)(total_size); + void *p = MALLOC(total_size); if (p) p = memset(p, 0, total_size); return p; @@ -452,9 +452,9 @@ wimlib_strdup(const char *str) char *p; size = strlen(str); - p = (*wimlib_malloc_func)(size + 1); + p = MALLOC(size + 1); if (p) - memcpy(p, str, size + 1); + p = memcpy(p, str, size + 1); return p; } @@ -466,7 +466,7 @@ wimlib_wcsdup(const wchar_t *str) wchar_t *p; size = wcslen(str); - p = (*wimlib_malloc_func)((size + 1) * sizeof(wchar_t)); + p = MALLOC((size + 1) * sizeof(wchar_t)); if (p) p = wmemcpy(p, str, size + 1); return p;