shithub: aubio

Download patch

ref: b5bd70ca13122ac12a925e443a513310606751e3
parent: 7fc8406b8f88cbc03290ffe6447758bbf9466b7f
author: Paul Brossier <piem@piem.org>
date: Sun Dec 16 14:04:46 EST 2018

[source] always call del_aubio_source to clean-up

--- a/src/io/source.c
+++ b/src/io/source.c
@@ -121,7 +121,7 @@
   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 @@
 }
 
 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);
 }