Browse Source

Close stream on error paths in LoadSpectSeq(spect.c). [Coverity]

master
Reece H. Dunn 9 years ago
parent
commit
a9adf136c6
1 changed files with 4 additions and 1 deletions
  1. 4
    1
      src/libespeak-ng/spect.c

+ 4
- 1
src/libespeak-ng/spect.c View File

} }
for (ix = 0; ix < n; ix++) { for (ix = 0; ix < n; ix++) {
SpectFrame *frame = SpectFrameCreate(); SpectFrame *frame = SpectFrameCreate();
if (!frame)
if (!frame) {
fclose(stream);
return ENOMEM; return ENOMEM;
}


espeak_ng_STATUS status = LoadFrame(frame, stream, spect->file_format); espeak_ng_STATUS status = LoadFrame(frame, stream, spect->file_format);
if (status != ENS_OK) { if (status != ENS_OK) {
free(frame); free(frame);
fclose(stream);
return status; return status;
} }



Loading…
Cancel
Save