From: Paul Brossier Date: Mon, 27 Feb 2017 00:33:21 +0000 (+0100) Subject: src/io/source_wavread.c: allow closing twice X-Git-Tag: 0.4.5~83 X-Git-Url: https://git.aubio.org/?a=commitdiff_plain;h=2882b3f907a0b27ce880f4ba4a79ce93a57d2856;p=aubio.git src/io/source_wavread.c: allow closing twice --- diff --git a/src/io/source_wavread.c b/src/io/source_wavread.c index 4565b33e..640201bb 100644 --- a/src/io/source_wavread.c +++ b/src/io/source_wavread.c @@ -439,8 +439,8 @@ uint_t aubio_source_wavread_get_duration (const aubio_source_wavread_t * s) { } uint_t aubio_source_wavread_close (aubio_source_wavread_t * s) { - if (!s->fid) { - return AUBIO_FAIL; + if (s->fid == NULL) { + return AUBIO_OK; } if (fclose(s->fid)) { AUBIO_ERR("source_wavread: could not close %s (%s)\n", s->path, strerror(errno));