[asterisk-commits] dvossel: branch dvossel/funk_effects r250960 - /team/dvossel/funk_effects/funcs/

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Thu Mar 4 23:52:08 CST 2010


Author: dvossel
Date: Thu Mar  4 23:52:05 2010
New Revision: 250960

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=250960
Log:
fixes possible memory leak

Modified:
    team/dvossel/funk_effects/funcs/func_pitchshift.c

Modified: team/dvossel/funk_effects/funcs/func_pitchshift.c
URL: http://svnview.digium.com/svn/asterisk/team/dvossel/funk_effects/funcs/func_pitchshift.c?view=diff&rev=250960&r1=250959&r2=250960
==============================================================================
--- team/dvossel/funk_effects/funcs/func_pitchshift.c (original)
+++ team/dvossel/funk_effects/funcs/func_pitchshift.c Thu Mar  4 23:52:05 2010
@@ -148,7 +148,7 @@
 	struct pitchshift_data *shift = data;
 
 	ast_audiohook_destroy(&shift->audiohook);
-	ast_free(data);
+	ast_free(shift);
 };
 
 static const struct ast_datastore_info pitchshift_datastore = {
@@ -208,6 +208,7 @@
 
 		ast_audiohook_init(&shift->audiohook, AST_AUDIOHOOK_TYPE_MANIPULATE, "pitch_shift");
 		shift->audiohook.manipulate_callback = pitchshift_cb;
+		datastore->data = shift;
 		new = 1;
 	} else {
 		ast_channel_unlock(chan);
@@ -245,7 +246,6 @@
 	}
 
 	if (new) {
-		datastore->data = shift;
 		ast_channel_lock(chan);
 		ast_channel_datastore_add(chan, datastore);
 		ast_channel_unlock(chan);




More information about the asterisk-commits mailing list