removed calloc calls from lib/

This commit is contained in:
inikep
2016-06-03 13:23:04 +02:00
parent db2f540414
commit 36fac00149
7 changed files with 7 additions and 33 deletions
+1 -7
View File
@@ -51,7 +51,6 @@
/*-*************************************
* Dependencies
***************************************/
#include <stdlib.h> /* malloc */
#include <string.h> /* memset */
#include "mem.h"
#define XXH_STATIC_LINKING_ONLY /* XXH64_state_t */
@@ -130,12 +129,7 @@ ZSTD_CCtx* ZSTD_createCCtx_advanced(ZSTD_customMem customMem)
ZSTD_CCtx* ctx;
if (!customMem.customAlloc && !customMem.customFree)
{
ctx = (ZSTD_CCtx*) calloc(1, sizeof(ZSTD_CCtx));
if (!ctx) return NULL;
memcpy(&ctx->customMem, &defaultCustomMem, sizeof(ZSTD_customMem));
return ctx;
}
customMem = defaultCustomMem;
if (!customMem.customAlloc || !customMem.customFree)
return NULL;