diff options
author | Gregory Maxwell <greg@xiph.org> | 2011-10-29 23:54:45 -0400 |
---|---|---|
committer | Jean-Marc Valin <jmvalin@jmvalin.ca> | 2011-10-30 00:02:28 -0400 |
commit | 38fc0d59bcad2846b59f21d0cc308e43ea9545b2 (patch) | |
tree | aa7eef082d9eda6b9284fa4c69bbdc345a24dbb7 /celt/opus_custom_demo.c | |
parent | a44e95abd0b6892401f1525cf1cd5590f93277de (diff) | |
download | opus-38fc0d59bcad2846b59f21d0cc308e43ea9545b2.tar.gz |
Fix some inconsequential file descriptor leaks in the demo tools to silence cppcheck warnings.
Diffstat (limited to 'celt/opus_custom_demo.c')
-rw-r--r-- | celt/opus_custom_demo.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/celt/opus_custom_demo.c b/celt/opus_custom_demo.c index 741d2bd5..e25341b8 100644 --- a/celt/opus_custom_demo.c +++ b/celt/opus_custom_demo.c @@ -97,6 +97,7 @@ int main(int argc, char *argv[]) if (!fout) { fprintf (stderr, "Could not open output file %s\n", argv[argc-1]); + fclose(fin); return 1; } @@ -104,12 +105,16 @@ int main(int argc, char *argv[]) if (err != 0) { fprintf(stderr, "Failed to create the encoder: %s\n", opus_strerror(err)); + fclose(fin); + fclose(fout); return 1; } dec = opus_custom_decoder_create(mode, channels, &err); if (err != 0) { fprintf(stderr, "Failed to create the decoder: %s\n", opus_strerror(err)); + fclose(fin); + fclose(fout); return 1; } opus_custom_decoder_ctl(dec, OPUS_GET_LOOKAHEAD(&skip)); |