mirror of
https://github.com/rhasspy/espeak-ng.git
synced 2026-11-19 02:57:05 +00:00
Close stream on error paths in LoadSpectSeq(spect.c). [Coverity]
This commit is contained in:
@@ -336,12 +336,15 @@ espeak_ng_STATUS LoadSpectSeq(SpectSeq *spect, const char *filename)
|
||||
}
|
||||
for (ix = 0; ix < n; ix++) {
|
||||
SpectFrame *frame = SpectFrameCreate();
|
||||
if (!frame)
|
||||
if (!frame) {
|
||||
fclose(stream);
|
||||
return ENOMEM;
|
||||
}
|
||||
|
||||
espeak_ng_STATUS status = LoadFrame(frame, stream, spect->file_format);
|
||||
if (status != ENS_OK) {
|
||||
free(frame);
|
||||
fclose(stream);
|
||||
return status;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user