python/ext/py-phasevoc.c: make sure to avoid double free
authorPaul Brossier <piem@piem.org>
Tue, 10 May 2016 21:21:37 +0000 (23:21 +0200)
committerPaul Brossier <piem@piem.org>
Tue, 10 May 2016 21:21:37 +0000 (23:21 +0200)
python/ext/py-phasevoc.c

index 62312ea..a08bb5c 100644 (file)
@@ -84,7 +84,9 @@ Py_pvoc_del (Py_pvoc *self, PyObject *unused)
 {
   Py_XDECREF(self->output);
   Py_XDECREF(self->routput);
-  del_aubio_pvoc(self->o);
+  if (self->o) {
+    del_aubio_pvoc(self->o);
+  }
   Py_TYPE(self)->tp_free((PyObject *) self);
 }