mirror of
https://github.com/asterisk/asterisk.git
synced 2025-09-21 20:56:39 +00:00
Fix a variety of memory corruption/assertion errors
* Initialize a Stasis-Core message type prior to initializing a caching topic. The caching topic will attempt to use the message type. * Don't attempt to publish Stasis-Core messages from remote console connections. They aren't the main process; they shouldn't attempt to behave as it (they also don't have the infrastructure to do so) * Don't treat a JSON object as an ao2 object (whoops) * In asterisk.c, ref bump the JSON even package that is distributed with the event meta data. The callers assume that they own the reference, and the packing routine steals references. git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@389785 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -784,6 +784,9 @@ static void devstate_exit(void)
|
||||
|
||||
int devstate_init(void)
|
||||
{
|
||||
if (STASIS_MESSAGE_TYPE_INIT(ast_device_state_message_type) != 0) {
|
||||
return -1;
|
||||
}
|
||||
device_state_topic_all = stasis_topic_create("ast_device_state_topic");
|
||||
if (!device_state_topic_all) {
|
||||
return -1;
|
||||
@@ -792,9 +795,6 @@ int devstate_init(void)
|
||||
if (!device_state_topic_cached) {
|
||||
return -1;
|
||||
}
|
||||
if (STASIS_MESSAGE_TYPE_INIT(ast_device_state_message_type) != 0) {
|
||||
return -1;
|
||||
}
|
||||
device_state_topic_pool = stasis_topic_pool_create(ast_device_state_topic_all());
|
||||
if (!device_state_topic_pool) {
|
||||
return -1;
|
||||
|
Reference in New Issue
Block a user