removed calloc calls from lib/
This commit is contained in:
@@ -59,7 +59,6 @@
|
||||
/* **************************************************************
|
||||
* Includes
|
||||
****************************************************************/
|
||||
#include <stdlib.h> /* malloc, free, qsort */
|
||||
#include <string.h> /* memcpy, memset */
|
||||
#include <stdio.h> /* printf (debug) */
|
||||
#include "huf_static.h"
|
||||
|
||||
@@ -108,13 +108,7 @@ ZBUFF_CCtx* ZBUFF_createCCtx_advanced(ZSTD_customMem customMem)
|
||||
ZBUFF_CCtx* zbc;
|
||||
|
||||
if (!customMem.customAlloc && !customMem.customFree)
|
||||
{
|
||||
zbc = (ZBUFF_CCtx*)calloc(1, sizeof(ZBUFF_CCtx));
|
||||
if (zbc==NULL) return NULL;
|
||||
memcpy(&zbc->customMem, &defaultCustomMem, sizeof(ZSTD_customMem));
|
||||
zbc->zc = ZSTD_createCCtx();
|
||||
return zbc;
|
||||
}
|
||||
customMem = defaultCustomMem;
|
||||
|
||||
if (!customMem.customAlloc || !customMem.customFree)
|
||||
return NULL;
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user