diff options
author | Matt Jordan <mjordan@digium.com> | 2015-05-20 15:23:04 -0500 |
---|---|---|
committer | Gerrit Code Review <gerrit2@gerrit.digium.api> | 2015-05-20 15:23:05 -0500 |
commit | 3f5a86037dc3b02933c8518e12827dba4852c155 (patch) | |
tree | 6e407e4711808f1dd3d53f988201035aae55713e /tests | |
parent | ddb7cbef8efdcccb63b62aff5b6b83e98e831da7 (diff) | |
parent | 0a46d43b9c36e1ad847455fc6577f1573e0cb216 (diff) |
Merge "Fix potential crash after unload of func_periodic_hook or test_message."
Diffstat (limited to 'tests')
-rw-r--r-- | tests/test_message.c | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/tests/test_message.c b/tests/test_message.c index 26cd90a4d..2c9334ad9 100644 --- a/tests/test_message.c +++ b/tests/test_message.c @@ -51,8 +51,6 @@ ASTERISK_REGISTER_FILE() /*! \brief The number of user events we should get in a dialplan test */ #define DEFAULT_EXPECTED_EVENTS 4 -static struct ast_context *test_message_context; - /*! \brief The current number of received user events */ static int received_user_events; @@ -822,9 +820,7 @@ static int unload_module(void) AST_TEST_UNREGISTER(test_message_has_destination_handler); AST_TEST_UNREGISTER(test_message_msg_send); - if (test_message_context) { - ast_context_destroy(test_message_context, AST_MODULE); - } + ast_context_destroy(NULL, AST_MODULE); ast_manager_unregister_hook(&user_event_hook); @@ -835,8 +831,7 @@ static int create_test_dialplan(void) { int res = 0; - test_message_context = ast_context_find_or_create(NULL, NULL, TEST_CONTEXT, AST_MODULE); - if (!test_message_context) { + if (!ast_context_find_or_create(NULL, NULL, TEST_CONTEXT, AST_MODULE)) { return -1; } |