From d8a88fc8e76bbb873d9ef58d06040339b06f6ed3 Mon Sep 17 00:00:00 2001 From: "Reece H. Dunn" Date: Mon, 11 Jan 2016 20:47:35 +0000 Subject: [PATCH] Call to malloc may return NULL in SpectCreateFrame(spect.c) [msvc /analyze] --- src/libespeak-ng/spect.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/libespeak-ng/spect.c b/src/libespeak-ng/spect.c index 47e5bde2..b9182d97 100644 --- a/src/libespeak-ng/spect.c +++ b/src/libespeak-ng/spect.c @@ -101,6 +101,9 @@ static SpectFrame *SpectFrameCreate() SpectFrame *frame; frame = malloc(sizeof(SpectFrame)); + if (!frame) + return NULL; + frame->keyframe = 0; frame->spect = NULL; frame->markers = 0; @@ -336,6 +339,8 @@ espeak_ng_STATUS LoadSpectSeq(SpectSeq *spect, const char *filename) } for (ix = 0; ix < n; ix++) { SpectFrame *frame = SpectFrameCreate(); + if (!frame) + return ENOMEM; if (LoadFrame(frame, stream, spect->file_format) != 0) { free(frame);