mirror of
https://github.com/facebook/zstd.git
synced 2025-10-17 00:07:08 -04:00
fixed : potential malloc error
This commit is contained in:
parent
f86c0e7d10
commit
7b2c31043c
@ -331,6 +331,7 @@ struct ZBUFF_DCtx_s {
|
|||||||
ZBUFF_DCtx* ZBUFF_createDCtx(void)
|
ZBUFF_DCtx* ZBUFF_createDCtx(void)
|
||||||
{
|
{
|
||||||
ZBUFF_DCtx* zbc = (ZBUFF_DCtx*)malloc(sizeof(ZBUFF_DCtx));
|
ZBUFF_DCtx* zbc = (ZBUFF_DCtx*)malloc(sizeof(ZBUFF_DCtx));
|
||||||
|
if (zbc==NULL) return NULL;
|
||||||
memset(zbc, 0, sizeof(*zbc));
|
memset(zbc, 0, sizeof(*zbc));
|
||||||
zbc->zc = ZSTD_createDCtx();
|
zbc->zc = ZSTD_createDCtx();
|
||||||
zbc->stage = ZBUFFds_init;
|
zbc->stage = ZBUFFds_init;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user