fixed : potential malloc error

This commit is contained in:
Yann Collet 2015-11-25 15:04:37 +01:00
parent 7b2c31043c
commit 377b9e8b94

View File

@ -98,6 +98,7 @@ struct ZBUFF_CCtx_s {
ZBUFF_CCtx* ZBUFF_createCCtx(void)
{
ZBUFF_CCtx* zbc = (ZBUFF_CCtx*)malloc(sizeof(ZBUFF_CCtx));
if (zbc==NULL) return NULL;
memset(zbc, 0, sizeof(*zbc));
zbc->zc = ZSTD_createCCtx();
return zbc;