From 98d7aaa3b399e2bf7479cf50458193e1d046c547 Mon Sep 17 00:00:00 2001 From: Paul Brossier Date: Fri, 21 Dec 2018 15:00:34 +0100 Subject: [PATCH] [py] check sink was created before calling del_aubio_sink --- python/ext/py-sink.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/python/ext/py-sink.c b/python/ext/py-sink.c index f2747761..4fc514f2 100644 --- a/python/ext/py-sink.c +++ b/python/ext/py-sink.c @@ -150,8 +150,10 @@ Py_sink_init (Py_sink * self, PyObject * args, PyObject * kwds) static void Py_sink_del (Py_sink *self, PyObject *unused) { - del_aubio_sink(self->o); - free(self->mwrite_data.data); + if (self->o) { + del_aubio_sink(self->o); + free(self->mwrite_data.data); + } if (self->uri) { free(self->uri); } -- 2.11.0