fixed : potential malloc error

This commit is contained in:
Yann Collet 2015-11-25 15:02:46 +01:00
parent f86c0e7d10
commit 7b2c31043c

View File

@ -331,6 +331,7 @@ struct ZBUFF_DCtx_s {
ZBUFF_DCtx* ZBUFF_createDCtx(void)
{
ZBUFF_DCtx* zbc = (ZBUFF_DCtx*)malloc(sizeof(ZBUFF_DCtx));
if (zbc==NULL) return NULL;
memset(zbc, 0, sizeof(*zbc));
zbc->zc = ZSTD_createDCtx();
zbc->stage = ZBUFFds_init;