From: Yann Collet Date: Wed, 25 Nov 2015 14:04:37 +0000 (+0100) Subject: fixed : potential malloc error X-Git-Tag: zstd-0.4.0^2~23^2~8 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=377b9e8b94deb7d974e423d6908ec6cfee3423f0;p=thirdparty%2Fzstd.git fixed : potential malloc error --- diff --git a/lib/zstd_buffered.c b/lib/zstd_buffered.c index eaa1d26fc..19ce06ebb 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;