From 377b9e8b94deb7d974e423d6908ec6cfee3423f0 Mon Sep 17 00:00:00 2001 From: Yann Collet Date: Wed, 25 Nov 2015 15:04:37 +0100 Subject: [PATCH] fixed : potential malloc error --- lib/zstd_buffered.c | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/zstd_buffered.c b/lib/zstd_buffered.c index eaa1d26f..19ce06eb 100644 --- a/lib/zstd_buffered.c +++ b/lib/zstd_buffered.c @@ -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;