diff --git a/src/switch_channel.c b/src/switch_channel.c index 1bc0113eb0..c5c65af6c5 100644 --- a/src/switch_channel.c +++ b/src/switch_channel.c @@ -665,7 +665,9 @@ SWITCH_DECLARE(void) switch_channel_clear_state_handler(switch_channel *channel, new_handlers[i++] = channel->state_handlers[index]; } } - memset(channel->state_handlers, 0, sizeof(channel->state_handlers)); + for (index = 0; index < SWITCH_MAX_STATE_HANDLERS; index++) { + channel->state_handlers[index] = NULL; + } for (index = 0; index < i; index++) { channel->state_handlers[index] = new_handlers[i]; } diff --git a/src/switch_core.c b/src/switch_core.c index 0fee185369..cba3335065 100644 --- a/src/switch_core.c +++ b/src/switch_core.c @@ -2393,7 +2393,7 @@ static void *SWITCH_THREAD_FUNC switch_core_sql_thread(switch_thread *thread, vo } if (diff < freq) { - diff = (switch_time_now() - last_commit) / 1000; + diff = (uint32_t)((switch_time_now() - last_commit) / 1000); } if (trans && (itterations == target || diff >= freq)) {