[hist] fix potential memory leak
authorPaul Brossier <piem@piem.org>
Thu, 6 Dec 2018 10:46:46 +0000 (11:46 +0100)
committerPaul Brossier <piem@piem.org>
Thu, 6 Dec 2018 10:46:46 +0000 (11:46 +0100)
src/utils/hist.c

index e0e2486..2dcc443 100644 (file)
@@ -44,6 +44,7 @@ aubio_hist_t * new_aubio_hist (smpl_t flow, smpl_t fhig, uint_t nelems){
   smpl_t accum = step;
   uint_t i;
   if ((sint_t)nelems <= 0) {
+    AUBIO_FREE(s);
     return NULL;
   }
   s->nelems = nelems;