[source] del_aubio_source argument can be null
authorPaul Brossier <piem@piem.org>
Fri, 21 Dec 2018 14:15:47 +0000 (15:15 +0100)
committerPaul Brossier <piem@piem.org>
Fri, 21 Dec 2018 14:15:47 +0000 (15:15 +0100)
Most del_ methods in aubio do not check if their argument is NULL, but
del_aubio_source used to, so we keep it this way to avoid breaking
existing programs.

src/io/source.c

index 5a2e493..c3ab7c9 100644 (file)
@@ -139,7 +139,7 @@ uint_t aubio_source_close(aubio_source_t * s) {
 
 void del_aubio_source(aubio_source_t * s) {
   AUBIO_ASSERT(s);
-  if (s->s_del && s->source)
+  if (s && s->s_del && s->source)
     s->s_del((void *)s->source);
   AUBIO_FREE(s);
 }