From 2882b3f907a0b27ce880f4ba4a79ce93a57d2856 Mon Sep 17 00:00:00 2001 From: Paul Brossier Date: Mon, 27 Feb 2017 01:33:21 +0100 Subject: [PATCH] src/io/source_wavread.c: allow closing twice --- src/io/source_wavread.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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)); -- 2.11.0