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

src/io/sink.c

index f8ac5fd..f3f56a3 100644 (file)
@@ -136,7 +136,7 @@ uint_t aubio_sink_close(aubio_sink_t *s) {
 
 void del_aubio_sink(aubio_sink_t * s) {
   AUBIO_ASSERT(s);
-  if (s->s_del && s->sink)
+  if (s && s->s_del && s->sink)
     s->s_del((void *)s->sink);
   AUBIO_FREE(s);
 }