Index: python/ext/aubiomodule.c
===================================================================
--- python/ext/aubiomodule.c	(revision 6f42c16b317d2a7363ccddb2783b75c6720042f5)
+++ python/ext/aubiomodule.c	(revision 569b363d02577c0445fe78385a94fcbedce8ede7)
@@ -84,5 +84,5 @@
 {
   PyObject *input;
-  fvec_t *vec;
+  fvec_t vec;
   smpl_t alpha;
   PyObject *result;
@@ -96,13 +96,10 @@
   }
 
-  vec = (fvec_t *)malloc(sizeof(fvec_t));
-  if (!PyAubio_ArrayToCFvec(input, vec)) {
-    free(vec);
+  if (!PyAubio_ArrayToCFvec(input, &vec)) {
     return NULL;
   }
 
   // compute the function
-  result = Py_BuildValue ("f", fvec_alpha_norm (vec, alpha));
-  free(vec);
+  result = Py_BuildValue ("f", fvec_alpha_norm (&vec, alpha));
   if (result == NULL) {
     return NULL;
@@ -176,5 +173,5 @@
 {
   PyObject *input;
-  fvec_t *vec;
+  fvec_t vec;
   PyObject *result;
 
@@ -187,13 +184,10 @@
   }
 
-  vec = (fvec_t *)malloc(sizeof(fvec_t));
-  if (!PyAubio_ArrayToCFvec(input, vec)) {
-    free(vec);
+  if (!PyAubio_ArrayToCFvec(input, &vec)) {
     return NULL;
   }
 
   // compute the function
-  result = Py_BuildValue ("f", aubio_zero_crossing_rate (vec));
-  free(vec);
+  result = Py_BuildValue ("f", aubio_zero_crossing_rate (&vec));
   if (result == NULL) {
     return NULL;
@@ -207,5 +201,5 @@
 {
   PyObject *input;
-  fvec_t *vec;
+  fvec_t vec;
 
   if (!PyArg_ParseTuple (args, "O:min_removal", &input)) {
@@ -217,17 +211,15 @@
   }
 
-  vec = (fvec_t *)malloc(sizeof(fvec_t));
-  if (!PyAubio_ArrayToCFvec(input, vec)) {
-    free(vec);
+  if (!PyAubio_ArrayToCFvec(input, &vec)) {
     return NULL;
   }
 
   // compute the function
-  fvec_min_removal (vec);
+  fvec_min_removal (&vec);
 
   // since this function does not return, we could return None
   //Py_RETURN_NONE;
   // however it is convenient to return the modified vector
-  return (PyObject *) PyAubio_CFvecToArray(vec);
+  return (PyObject *) PyAubio_CFvecToArray(&vec);
   // or even without converting it back to an array
   //Py_INCREF(vec);
Index: python/ext/aubioproxy.c
===================================================================
--- python/ext/aubioproxy.c	(revision 6f42c16b317d2a7363ccddb2783b75c6720042f5)
+++ python/ext/aubioproxy.c	(revision 569b363d02577c0445fe78385a94fcbedce8ede7)
@@ -144,15 +144,13 @@
   }
 
-  if (mat->height != (uint_t)PyArray_DIM ((PyArrayObject *)input, 0)) {
-    /*
-    free(mat->data);
-    mat->height = (uint_t)PyArray_DIM ((PyArrayObject *)input, 0);
-    mat->data = (smpl_t **)malloc(sizeof(smpl_t*) * mat->height);
-    */
-    PyErr_Format(PyExc_ValueError, "too many rows, %d but %ld expected",
-                      mat->height, PyArray_DIM ((PyArrayObject *)input, 0) );
-    return 0;
+  uint_t new_height = (uint_t)PyArray_DIM ((PyArrayObject *)input, 0);
+  if (mat->height != new_height) {
+    if (mat->data) {
+      free(mat->data);
+    }
+    mat->data = (smpl_t **)malloc(sizeof(smpl_t*) * new_height);
   }
 
+  mat->height = new_height;
   mat->length = (uint_t)PyArray_DIM ((PyArrayObject *)input, 1);
   for (i=0; i< mat->height; i++) {
Index: python/ext/py-fft.c
===================================================================
--- python/ext/py-fft.c	(revision 6f42c16b317d2a7363ccddb2783b75c6720042f5)
+++ python/ext/py-fft.c	(revision 569b363d02577c0445fe78385a94fcbedce8ede7)
@@ -8,9 +8,12 @@
   aubio_fft_t * o;
   uint_t win_s;
-  fvec_t *vecin;
+  // do / rdo input vectors
+  fvec_t vecin;
+  cvec_t cvecin;
+  // do / rdo output results
   cvec_t *out;
+  fvec_t *rout;
+  // bridge for cvec output
   Py_cvec *py_out;
-  cvec_t *cvecin;
-  fvec_t *rout;
 } Py_fft;
 
@@ -57,7 +60,4 @@
   }
 
-  self->cvecin = (cvec_t *)malloc(sizeof(cvec_t));
-  self->vecin = (fvec_t *)malloc(sizeof(fvec_t));
-
   self->out = new_cvec(self->win_s);
   self->py_out = (Py_cvec*) PyObject_New (Py_cvec, &Py_cvecType);
@@ -75,6 +75,4 @@
   del_cvec(self->out);
   del_fvec(self->rout);
-  free(self->cvecin);
-  free(self->vecin);
   Py_TYPE(self)->tp_free((PyObject *) self);
 }
@@ -89,10 +87,10 @@
   }
 
-  if (!PyAubio_ArrayToCFvec(input, self->vecin)) {
+  if (!PyAubio_ArrayToCFvec(input, &(self->vecin))) {
     return NULL;
   }
 
   // compute the function
-  aubio_fft_do (((Py_fft *)self)->o, self->vecin, self->out);
+  aubio_fft_do (((Py_fft *)self)->o, &(self->vecin), self->out);
 #if 0
   Py_cvec * py_out = (Py_cvec*) PyObject_New (Py_cvec, &Py_cvecType);
@@ -120,10 +118,10 @@
   }
 
-  if (!PyAubio_ArrayToCCvec (input, self->cvecin) ) {
+  if (!PyAubio_ArrayToCCvec (input, &(self->cvecin)) ) {
     return NULL;
   }
 
   // compute the function
-  aubio_fft_rdo (self->o, self->cvecin, self->rout);
+  aubio_fft_rdo (self->o, &(self->cvecin), self->rout);
   return PyAubio_CFvecToArray(self->rout);
 }
Index: python/ext/py-filter.c
===================================================================
--- python/ext/py-filter.c	(revision 6f42c16b317d2a7363ccddb2783b75c6720042f5)
+++ python/ext/py-filter.c	(revision 569b363d02577c0445fe78385a94fcbedce8ede7)
@@ -6,5 +6,5 @@
   aubio_filter_t * o;
   uint_t order;
-  fvec_t *vec;
+  fvec_t vec;
   fvec_t *out;
 } Py_filter;
@@ -51,5 +51,4 @@
   }
   self->out = new_fvec(Py_default_vector_length);
-  self->vec = (fvec_t *)malloc(sizeof(fvec_t));
   return 0;
 }
@@ -60,5 +59,4 @@
   del_fvec(self->out);
   del_aubio_filter (self->o);
-  free(self->vec);
   Py_TYPE(self)->tp_free ((PyObject *) self);
 }
@@ -77,15 +75,15 @@
   }
 
-  if (!PyAubio_ArrayToCFvec(input, self->vec)) {
+  if (!PyAubio_ArrayToCFvec(input, &(self->vec))) {
     return NULL;
   }
 
   // reallocate the output if needed
-  if (self->vec->length != self->out->length) {
+  if (self->vec.length != self->out->length) {
     del_fvec(self->out);
-    self->out = new_fvec(self->vec->length);
+    self->out = new_fvec(self->vec.length);
   }
   // compute the function
-  aubio_filter_do_outplace (self->o, self->vec, self->out);
+  aubio_filter_do_outplace (self->o, &(self->vec), self->out);
   return PyAubio_CFvecToArray(self->out);
 }
Index: python/ext/py-filterbank.c
===================================================================
--- python/ext/py-filterbank.c	(revision 6f42c16b317d2a7363ccddb2783b75c6720042f5)
+++ python/ext/py-filterbank.c	(revision 569b363d02577c0445fe78385a94fcbedce8ede7)
@@ -9,8 +9,8 @@
   uint_t n_filters;
   uint_t win_s;
-  cvec_t *vec;
+  cvec_t vec;
+  fvec_t freqs;
+  fmat_t coeffs;
   fvec_t *out;
-  fvec_t *freqs;
-  fmat_t *coeffs;
 } Py_filterbank;
 
@@ -67,12 +67,4 @@
   self->out = new_fvec(self->n_filters);
 
-  self->vec = (cvec_t *)malloc(sizeof(cvec_t));
-
-  self->freqs = (fvec_t *)malloc(sizeof(fvec_t));
-
-  self->coeffs = (fmat_t *)malloc(sizeof(fmat_t));
-  self->coeffs->data = (smpl_t **)malloc(sizeof(smpl_t*) * self->n_filters);
-  self->coeffs->height = self->n_filters;
-
   return 0;
 }
@@ -83,8 +75,5 @@
   del_aubio_filterbank(self->o);
   del_fvec(self->out);
-  free(self->vec);
-  free(self->freqs);
-  free(self->coeffs->data);
-  free(self->coeffs);
+  free(self->coeffs.data);
   Py_TYPE(self)->tp_free((PyObject *) self);
 }
@@ -99,10 +88,10 @@
   }
 
-  if (!PyAubio_ArrayToCCvec(input, self->vec)) {
+  if (!PyAubio_ArrayToCCvec(input, &(self->vec) )) {
     return NULL;
   }
 
   // compute the function
-  aubio_filterbank_do (self->o, self->vec, self->out);
+  aubio_filterbank_do (self->o, &(self->vec), self->out);
   return (PyObject *)PyAubio_CFvecToArray(self->out);
 }
@@ -131,10 +120,10 @@
   }
 
-  if (!PyAubio_ArrayToCFvec(input, self->freqs)) {
+  if (!PyAubio_ArrayToCFvec(input, &(self->freqs) )) {
     return NULL;
   }
 
   err = aubio_filterbank_set_triangle_bands (self->o,
-      self->freqs, samplerate);
+      &(self->freqs), samplerate);
   if (err > 0) {
     PyErr_SetString (PyExc_ValueError,
@@ -174,9 +163,9 @@
   }
 
-  if (!PyAubio_ArrayToCFmat(input, self->coeffs)) {
-    return NULL;
-  }
-
-  err = aubio_filterbank_set_coeffs (self->o, self->coeffs);
+  if (!PyAubio_ArrayToCFmat(input, &(self->coeffs))) {
+    return NULL;
+  }
+
+  err = aubio_filterbank_set_coeffs (self->o, &(self->coeffs));
 
   if (err > 0) {
Index: python/ext/py-musicutils.c
===================================================================
--- python/ext/py-musicutils.c	(revision 6f42c16b317d2a7363ccddb2783b75c6720042f5)
+++ python/ext/py-musicutils.c	(revision 569b363d02577c0445fe78385a94fcbedce8ede7)
@@ -26,5 +26,5 @@
 {
   PyObject *input;
-  fvec_t *vec;
+  fvec_t vec;
   PyObject *level_lin;
 
@@ -38,12 +38,9 @@
   }
 
-  vec = (fvec_t *)malloc(sizeof(fvec_t));
-  if (!PyAubio_ArrayToCFvec(input, vec)) {
-    free(vec);
+  if (!PyAubio_ArrayToCFvec(input, &vec)) {
     return NULL;
   }
 
-  level_lin = Py_BuildValue("f", aubio_level_lin(vec));
-  free(vec);
+  level_lin = Py_BuildValue("f", aubio_level_lin(&vec));
   if (level_lin == NULL) {
     PyErr_SetString (PyExc_ValueError, "failed computing level_lin");
@@ -58,5 +55,5 @@
 {
   PyObject *input;
-  fvec_t *vec;
+  fvec_t vec;
   PyObject *db_spl;
 
@@ -70,12 +67,9 @@
   }
 
-  vec = (fvec_t *)malloc(sizeof(fvec_t));
-  if (!PyAubio_ArrayToCFvec(input, vec)) {
-    free(vec);
+  if (!PyAubio_ArrayToCFvec(input, &vec)) {
     return NULL;
   }
 
-  db_spl = Py_BuildValue("f", aubio_db_spl(vec));
-  free(vec);
+  db_spl = Py_BuildValue("f", aubio_db_spl(&vec));
   if (db_spl == NULL) {
     PyErr_SetString (PyExc_ValueError, "failed computing db_spl");
@@ -90,5 +84,5 @@
 {
   PyObject *input;
-  fvec_t *vec;
+  fvec_t vec;
   PyObject *silence_detection;
   smpl_t threshold;
@@ -103,12 +97,9 @@
   }
 
-  vec = (fvec_t *)malloc(sizeof(fvec_t));
-  if (!PyAubio_ArrayToCFvec(input, vec)) {
-    free(vec);
+  if (!PyAubio_ArrayToCFvec(input, &vec)) {
     return NULL;
   }
 
-  silence_detection = Py_BuildValue("I", aubio_silence_detection(vec, threshold));
-  free(vec);
+  silence_detection = Py_BuildValue("I", aubio_silence_detection(&vec, threshold));
   if (silence_detection == NULL) {
     PyErr_SetString (PyExc_ValueError, "failed computing silence_detection");
@@ -123,5 +114,5 @@
 {
   PyObject *input;
-  fvec_t *vec;
+  fvec_t vec;
   PyObject *level_detection;
   smpl_t threshold;
@@ -136,12 +127,9 @@
   }
 
-  vec = (fvec_t *)malloc(sizeof(fvec_t));
-  if (!PyAubio_ArrayToCFvec(input, vec)) {
-    free(vec);
+  if (!PyAubio_ArrayToCFvec(input, &vec)) {
     return NULL;
   }
 
-  level_detection = Py_BuildValue("f", aubio_level_detection(vec, threshold));
-  free(vec);
+  level_detection = Py_BuildValue("f", aubio_level_detection(&vec, threshold));
   if (level_detection == NULL) {
     PyErr_SetString (PyExc_ValueError, "failed computing level_detection");
Index: python/ext/py-phasevoc.c
===================================================================
--- python/ext/py-phasevoc.c	(revision 6f42c16b317d2a7363ccddb2783b75c6720042f5)
+++ python/ext/py-phasevoc.c	(revision 569b363d02577c0445fe78385a94fcbedce8ede7)
@@ -1,5 +1,3 @@
 #include "aubio-types.h"
-
-static char Py_pvoc_doc[] = "pvoc object";
 
 typedef struct
@@ -9,8 +7,8 @@
   uint_t win_s;
   uint_t hop_s;
-  fvec_t *vecin;
+  fvec_t vecin;
   cvec_t *output;
   Py_cvec *py_out;
-  cvec_t *cvecin;
+  cvec_t cvecin;
   fvec_t *routput;
 } Py_pvoc;
@@ -72,7 +70,4 @@
   }
 
-  self->cvecin = (cvec_t *)malloc(sizeof(cvec_t));
-  self->vecin = (fvec_t *)malloc(sizeof(fvec_t));
-
   self->output = new_cvec(self->win_s);
   self->py_out = (Py_cvec*) PyObject_New (Py_cvec, &Py_cvecType);
@@ -89,6 +84,4 @@
   del_cvec(self->output);
   del_fvec(self->routput);
-  free(self->cvecin);
-  free(self->vecin);
   Py_TYPE(self)->tp_free((PyObject *) self);
 }
@@ -104,10 +97,10 @@
   }
 
-  if (!PyAubio_ArrayToCFvec (input, self->vecin)) {
+  if (!PyAubio_ArrayToCFvec (input, &(self->vecin) )) {
     return NULL;
   }
 
   // compute the function
-  aubio_pvoc_do (self->o, self->vecin, self->output);
+  aubio_pvoc_do (self->o, &(self->vecin), self->output);
 #if 0
   Py_cvec * py_out = (Py_cvec*) PyObject_New (Py_cvec, &Py_cvecType);
@@ -136,10 +129,10 @@
   }
 
-  if (!PyAubio_ArrayToCCvec (input, self->cvecin)) {
+  if (!PyAubio_ArrayToCCvec (input, &(self->cvecin) )) {
     return NULL;
   }
 
   // compute the function
-  aubio_pvoc_rdo (self->o, self->cvecin, self->routput);
+  aubio_pvoc_rdo (self->o, &(self->cvecin), self->routput);
   return PyAubio_CFvecToArray(self->routput);
 }
Index: python/ext/py-sink.c
===================================================================
--- python/ext/py-sink.c	(revision 6f42c16b317d2a7363ccddb2783b75c6720042f5)
+++ python/ext/py-sink.c	(revision 569b363d02577c0445fe78385a94fcbedce8ede7)
@@ -8,6 +8,6 @@
   uint_t samplerate;
   uint_t channels;
-  fvec_t *write_data;
-  fmat_t *mwrite_data;
+  fvec_t write_data;
+  fmat_t mwrite_data;
 } Py_sink;
 
@@ -124,8 +124,4 @@
   self->channels = aubio_sink_get_channels ( self->o );
 
-  self->write_data = (fvec_t *)malloc(sizeof(fvec_t));
-  self->mwrite_data = (fmat_t *)malloc(sizeof(fmat_t));
-  self->mwrite_data->height = self->channels;
-  self->mwrite_data->data = (smpl_t **)malloc(sizeof(smpl_t*) * self->channels);
   return 0;
 }
@@ -135,7 +131,5 @@
 {
   del_aubio_sink(self->o);
-  free(self->write_data);
-  free(self->mwrite_data->data);
-  free(self->mwrite_data);
+  free(self->mwrite_data.data);
   Py_TYPE(self)->tp_free((PyObject *) self);
 }
@@ -157,5 +151,5 @@
 
   /* input vectors parsing */
-  if (!PyAubio_ArrayToCFvec(write_data_obj, self->write_data)) {
+  if (!PyAubio_ArrayToCFvec(write_data_obj, &(self->write_data))) {
     return NULL;
   }
@@ -163,5 +157,5 @@
 
   /* compute _do function */
-  aubio_sink_do (self->o, self->write_data, write);
+  aubio_sink_do (self->o, &(self->write_data), write);
 
   Py_RETURN_NONE;
@@ -185,10 +179,10 @@
 
   /* input vectors parsing */
-  if (!PyAubio_ArrayToCFmat(write_data_obj, self->mwrite_data)) {
+  if (!PyAubio_ArrayToCFmat(write_data_obj, &(self->mwrite_data))) {
     return NULL;
   }
 
   /* compute _do function */
-  aubio_sink_do_multi (self->o, self->mwrite_data, write);
+  aubio_sink_do_multi (self->o, &(self->mwrite_data), write);
   Py_RETURN_NONE;
 }
