From ea0aa13aa8e2ea48606da49b979ad85f1aa9c194 Mon Sep 17 00:00:00 2001 From: "turaj@webrtc.org" Date: Wed, 23 May 2012 15:43:51 +0000 Subject: [PATCH] I haven't done any refactoring here. Resolve coverity warnings. 14240, 14241. In ACM: - NULL pointer sanity checks corrected. Tested with trybots. BUG=None TEST=None Review URL: https://webrtc-codereview.appspot.com/571012 git-svn-id: http://webrtc.googlecode.com/svn/trunk@2281 4adac7df-926f-26a2-2b94-8c16560cd09d --- src/modules/audio_coding/codecs/cng/webrtc_cng.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/modules/audio_coding/codecs/cng/webrtc_cng.c b/src/modules/audio_coding/codecs/cng/webrtc_cng.c index 65f667220a..6d95f1152d 100644 --- a/src/modules/audio_coding/codecs/cng/webrtc_cng.c +++ b/src/modules/audio_coding/codecs/cng/webrtc_cng.c @@ -180,7 +180,7 @@ WebRtc_Word16 WebRtcCng_AssignDec(CNG_dec_inst **inst, void *CNG_inst_Addr) WebRtc_Word16 WebRtcCng_CreateEnc(CNG_enc_inst **cng_inst) { *cng_inst=(CNG_enc_inst*)malloc(sizeof(WebRtcCngEncInst_t)); - if(cng_inst!=NULL) { + if(*cng_inst!=NULL) { (*(WebRtcCngEncInst_t**) cng_inst)->errorcode = 0; (*(WebRtcCngEncInst_t**) cng_inst)->initflag = 0; return(0); @@ -194,7 +194,7 @@ WebRtc_Word16 WebRtcCng_CreateEnc(CNG_enc_inst **cng_inst) WebRtc_Word16 WebRtcCng_CreateDec(CNG_dec_inst **cng_inst) { *cng_inst=(CNG_dec_inst*)malloc(sizeof(WebRtcCngDecInst_t)); - if(cng_inst!=NULL) { + if(*cng_inst!=NULL) { (*(WebRtcCngDecInst_t**) cng_inst)->errorcode = 0; (*(WebRtcCngDecInst_t**) cng_inst)->initflag = 0; return(0);