shithub: sox

Download patch

ref: a44503f44e9973c539df5646d258a466e6fb2a9d
parent: ca3acec8ffe3460b8cd80008c31703030f020a10
author: Ulrich Klauer <ulrich@chirlu.de>
date: Tue Oct 11 20:40:26 EDT 2011

Fix two more memory leaks

--- a/src/effects.c
+++ b/src/effects.c
@@ -161,6 +161,8 @@
   if (ret == SOX_EFF_NULL) {
     lsx_report("has no effect in this configuration");
     free(eff0.priv);
+    free(effp->priv);
+    effp->priv = NULL;
     return SOX_SUCCESS;
   }
   if (ret != SOX_SUCCESS) {
--- a/src/sox.c
+++ b/src/sox.c
@@ -155,7 +155,7 @@
   rg_mode replay_gain_mode;
 } file_t;
 
-static file_t * * files; /* Array tracking input and output files */
+static file_t * * files = NULL; /* Array tracking input and output files */
 #define ofile files[file_count - 1]
 static size_t file_count = 0;
 static size_t input_count = 0;
@@ -240,6 +240,8 @@
     free(ofile->filename);
     free(ofile);
   }
+
+  free(files);
 
 #ifdef HAVE_TERMIOS_H
   if (original_termios_saved)