FSCORE-373

git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@13508 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
Anthony Minessale
2009-05-29 18:48:54 +00:00
parent 6eb2b39f4d
commit 72c680f005
3 changed files with 11 additions and 2 deletions
+9 -2
View File
@@ -82,12 +82,19 @@ SWITCH_DECLARE(switch_status_t) switch_frame_dup(switch_frame_t *orig, switch_fr
{
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 @@ SWITCH_DECLARE(switch_status_t) switch_frame_free(switch_frame_t **frame)
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;