shithub: sox

Download patch

ref: c443ca782b15056814dea30c8574487366c3c164
parent: f410bc6f3826c37e9a21e3e71a33efb47c7aa82f
author: Ulrich Klauer <ulrich@chirlu.de>
date: Sat Sep 1 12:57:02 EDT 2012

Seal a memory leak in do-nothing effects

If an effect returned SOX_EFF_NULL, the effect's kill handler was never
called, and consequently any memory allocated by its create handler
never freed. This change calls the kill handler from within
sox_add_effect() when SOX_EFF_NULL is detected.

--- a/src/effects.c
+++ b/src/effects.c
@@ -158,6 +158,7 @@
   if (ret == SOX_EFF_NULL) {
     lsx_report("has no effect in this configuration");
     free(eff0.priv);
+    effp->handler.kill(effp);
     free(effp->priv);
     effp->priv = NULL;
     return SOX_SUCCESS;