fix some mem leaks
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@9329 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
parent
8bece18e26
commit
a8d457eb09
|
@ -1115,7 +1115,7 @@ static void *SWITCH_THREAD_FUNC listener_run(switch_thread_t *thread, void *obj)
|
||||||
char reply[512] = "";
|
char reply[512] = "";
|
||||||
switch_core_session_t *session = NULL;
|
switch_core_session_t *session = NULL;
|
||||||
switch_channel_t *channel = NULL;
|
switch_channel_t *channel = NULL;
|
||||||
|
switch_event_t *revent = NULL;
|
||||||
|
|
||||||
switch_mutex_lock(listen_list.mutex);
|
switch_mutex_lock(listen_list.mutex);
|
||||||
prefs.threads++;
|
prefs.threads++;
|
||||||
|
@ -1234,8 +1234,6 @@ static void *SWITCH_THREAD_FUNC listener_run(switch_thread_t *thread, void *obj)
|
||||||
}
|
}
|
||||||
|
|
||||||
while (switch_test_flag(listener, LFLAG_RUNNING) && listen_list.ready) {
|
while (switch_test_flag(listener, LFLAG_RUNNING) && listen_list.ready) {
|
||||||
switch_event_t *revent;
|
|
||||||
|
|
||||||
len = sizeof(buf);
|
len = sizeof(buf);
|
||||||
memset(buf, 0, len);
|
memset(buf, 0, len);
|
||||||
status = read_packet(listener, &revent, 0);
|
status = read_packet(listener, &revent, 0);
|
||||||
|
@ -1253,6 +1251,8 @@ static void *SWITCH_THREAD_FUNC listener_run(switch_thread_t *thread, void *obj)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
switch_event_destroy(&revent);
|
||||||
|
|
||||||
if (*reply != '\0') {
|
if (*reply != '\0') {
|
||||||
if (*reply == '~') {
|
if (*reply == '~') {
|
||||||
switch_snprintf(buf, sizeof(buf), "Content-Type: command/reply\n%s", reply + 1);
|
switch_snprintf(buf, sizeof(buf), "Content-Type: command/reply\n%s", reply + 1);
|
||||||
|
@ -1267,6 +1267,10 @@ static void *SWITCH_THREAD_FUNC listener_run(switch_thread_t *thread, void *obj)
|
||||||
|
|
||||||
done:
|
done:
|
||||||
|
|
||||||
|
if (revent) {
|
||||||
|
switch_event_destroy(&revent);
|
||||||
|
}
|
||||||
|
|
||||||
remove_listener(listener);
|
remove_listener(listener);
|
||||||
|
|
||||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Session complete, waiting for children\n");
|
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Session complete, waiting for children\n");
|
||||||
|
|
|
@ -1093,7 +1093,11 @@ SWITCH_DECLARE(switch_status_t) switch_event_unbind_callback(switch_event_callba
|
||||||
EVENT_NODES[n->event_id] = n->next;
|
EVENT_NODES[n->event_id] = n->next;
|
||||||
}
|
}
|
||||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_NOTICE, "Event Binding deleted for %s:%s\n", n->id, switch_event_name(n->event_id));
|
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_NOTICE, "Event Binding deleted for %s:%s\n", n->id, switch_event_name(n->event_id));
|
||||||
n->subclass = NULL;
|
if (n->subclass) {
|
||||||
|
FREE(n->subclass->owner);
|
||||||
|
FREE(n->subclass->name);
|
||||||
|
FREE(n->subclass);
|
||||||
|
}
|
||||||
FREE(n->id);
|
FREE(n->id);
|
||||||
FREE(n);
|
FREE(n);
|
||||||
status = SWITCH_STATUS_SUCCESS;
|
status = SWITCH_STATUS_SUCCESS;
|
||||||
|
|
Loading…
Reference in New Issue