From: Paul Brossier Date: Sun, 16 Dec 2018 18:04:46 +0000 (+0100) Subject: [source] always call del_aubio_source to clean-up X-Git-Tag: 0.4.9~104 X-Git-Url: https://git.aubio.org/?a=commitdiff_plain;h=b5bd70ca13122ac12a925e443a513310606751e3;p=aubio.git [source] always call del_aubio_source to clean-up --- diff --git a/src/io/source.c b/src/io/source.c index 41581bf5..6af6c3fd 100644 --- a/src/io/source.c +++ b/src/io/source.c @@ -121,7 +121,7 @@ aubio_source_t * new_aubio_source(const char_t * uri, uint_t samplerate, uint_t AUBIO_ERROR("source: failed creating with %s at %dHz with hop size %d" " (no source built-in)\n", uri, samplerate, hop_size); #endif - AUBIO_FREE(s); + del_aubio_source(s); return NULL; } @@ -138,8 +138,8 @@ uint_t aubio_source_close(aubio_source_t * s) { } void del_aubio_source(aubio_source_t * s) { - if (!s) return; - s->s_del((void *)s->source); + if (s->s_del && s->source) + s->s_del((void *)s->source); AUBIO_FREE(s); }