[Freeswitch-svn] [commit] r13508 - in freeswitch/trunk/src: . mod/languages/mod_spidermonkey_teletone
FreeSWITCH SVN
anthm at freeswitch.org
Fri May 29 11:48:55 PDT 2009
Author: anthm
Date: Fri May 29 13:48:54 2009
New Revision: 13508
Log:
FSCORE-373
Modified:
freeswitch/trunk/src/mod/languages/mod_spidermonkey_teletone/mod_spidermonkey_teletone.c
freeswitch/trunk/src/switch_ivr_play_say.c
freeswitch/trunk/src/switch_utils.c
Modified: freeswitch/trunk/src/mod/languages/mod_spidermonkey_teletone/mod_spidermonkey_teletone.c
==============================================================================
--- freeswitch/trunk/src/mod/languages/mod_spidermonkey_teletone/mod_spidermonkey_teletone.c (original)
+++ freeswitch/trunk/src/mod/languages/mod_spidermonkey_teletone/mod_spidermonkey_teletone.c Fri May 29 13:48:54 2009
@@ -234,6 +234,7 @@
session = tto->session;
write_frame.codec = &tto->codec;
write_frame.data = fdata;
+ write_frame.buflen = sizeof(fdata);
channel = switch_core_session_get_channel(session);
Modified: freeswitch/trunk/src/switch_ivr_play_say.c
==============================================================================
--- freeswitch/trunk/src/switch_ivr_play_say.c (original)
+++ freeswitch/trunk/src/switch_ivr_play_say.c Fri May 29 13:48:54 2009
@@ -731,6 +731,7 @@
memset(&ts, 0, sizeof(ts));
write_frame.codec = &write_codec;
write_frame.data = data;
+ write_frame.buflen = sizeof(data);
switch_buffer_create_dynamic(&audio_buffer, 512, 1024, 0);
teletone_init_session(&ts, 0, teletone_handler, audio_buffer);
Modified: freeswitch/trunk/src/switch_utils.c
==============================================================================
--- freeswitch/trunk/src/switch_utils.c (original)
+++ freeswitch/trunk/src/switch_utils.c Fri May 29 13:48:54 2009
@@ -82,12 +82,19 @@
{
switch_frame_t *new_frame;
+ if (!orig) {
+ return SWITCH_STATUS_FALSE;
+ }
+
+ switch_assert(orig->buflen);
+
new_frame = malloc(sizeof(*new_frame));
switch_assert(new_frame);
*new_frame = *orig;
switch_set_flag(new_frame, SFF_DYNAMIC);
+
new_frame->data = malloc(new_frame->buflen);
switch_assert(new_frame->data);
@@ -104,8 +111,8 @@
if (!frame || !*frame || !switch_test_flag((*frame), SFF_DYNAMIC)) {
return SWITCH_STATUS_FALSE;
}
-
- free((*frame)->data);
+
+ switch_safe_free((*frame)->data);
free(*frame);
*frame = NULL;
More information about the Freeswitch-svn
mailing list