mirror of
https://github.com/facebook/zstd.git
synced 2025-12-08 00:03:24 -05:00
fixed : potential malloc error
This commit is contained in:
parent
7b2c31043c
commit
377b9e8b94
@ -98,6 +98,7 @@ struct ZBUFF_CCtx_s {
|
|||||||
ZBUFF_CCtx* ZBUFF_createCCtx(void)
|
ZBUFF_CCtx* ZBUFF_createCCtx(void)
|
||||||
{
|
{
|
||||||
ZBUFF_CCtx* zbc = (ZBUFF_CCtx*)malloc(sizeof(ZBUFF_CCtx));
|
ZBUFF_CCtx* zbc = (ZBUFF_CCtx*)malloc(sizeof(ZBUFF_CCtx));
|
||||||
|
if (zbc==NULL) return NULL;
|
||||||
memset(zbc, 0, sizeof(*zbc));
|
memset(zbc, 0, sizeof(*zbc));
|
||||||
zbc->zc = ZSTD_createCCtx();
|
zbc->zc = ZSTD_createCCtx();
|
||||||
return zbc;
|
return zbc;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user