mirror of
https://github.com/signalwire/freeswitch.git
synced 2025-04-14 08:05:37 +00:00
Remember kids, practice safe memory management!
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@12888 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
parent
8f10e92f15
commit
3c84c89744
@ -207,8 +207,8 @@ static switch_status_t handle_msg_fetch_reply(listener_t *listener, ei_x_buff *
|
||||
}
|
||||
|
||||
/*switch_core_hash_insert(listener->fetch_reply_hash, uuid_str, nbuf);*/
|
||||
free(nbuf->buff);
|
||||
free(nbuf);
|
||||
switch_safe_free(nbuf->buff);
|
||||
switch_safe_free(nbuf);
|
||||
}
|
||||
return SWITCH_STATUS_SUCCESS;
|
||||
}
|
||||
@ -794,7 +794,7 @@ static switch_status_t handle_ref_tuple(listener_t *listener, erlang_msg *msg, e
|
||||
ei_x_encode_atom(rbuf, "invalid_ref");
|
||||
}
|
||||
|
||||
free(pid); /* don't need it */
|
||||
switch_safe_free(pid); /* don't need it */
|
||||
|
||||
return SWITCH_STATUS_SUCCESS;
|
||||
}
|
||||
|
@ -442,9 +442,9 @@ static switch_xml_t erlang_fetch(const char *sectionstr, const char *tag_name, c
|
||||
|
||||
/* cleanup */
|
||||
switch_core_hash_delete(ptr->listener->fetch_reply_hash, uuid_str);
|
||||
free(rep->buff);
|
||||
free(rep);
|
||||
free(xmlstr);
|
||||
switch_safe_free(rep->buff);
|
||||
switch_safe_free(rep);
|
||||
switch_safe_free(xmlstr);
|
||||
|
||||
return xml;
|
||||
}
|
||||
@ -624,8 +624,8 @@ static void check_log_queue(listener_t *listener)
|
||||
switch_mutex_unlock(listener->sock_mutex);
|
||||
|
||||
ei_x_free(&lbuf);
|
||||
free(dnode->data);
|
||||
free(dnode);
|
||||
switch_safe_free(dnode->data);
|
||||
switch_safe_free(dnode);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1145,7 +1145,7 @@ session_elem_t* attach_call_to_spawned_process(listener_t* listener, char *modul
|
||||
|
||||
session_element->process.type = ERLANG_PID;
|
||||
memcpy(&session_element->process.pid, pid, sizeof(erlang_pid));
|
||||
free(pid); /* malloced in handle_ref_tuple */
|
||||
switch_safe_free(pid); /* malloced in handle_ref_tuple */
|
||||
switch_set_flag(session_element, LFLAG_SESSION_ALIVE);
|
||||
switch_clear_flag(session_element, LFLAG_OUTBOUND_INIT);
|
||||
switch_clear_flag(session_element, LFLAG_WAITING_FOR_PID);
|
||||
|
Loading…
x
Reference in New Issue
Block a user