summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoshua Colp <jcolp@digium.com>2017-10-24 13:56:43 -0500
committerGerrit Code Review <gerrit2@gerrit.digium.api>2017-10-24 13:56:43 -0500
commit909fe2f833c14a45abffcb0a1f5dc96ee36d1cc9 (patch)
treeb085d250fe71d26c1d1c8d707c10c592a6742b23
parent4cc36594ef4fb59f0eb87671e09c523c1b4b0bcf (diff)
parenta9e9608982bcdf983848e0db83bfa08eefc14d7f (diff)
Merge "test_config: Fix failure and segfault when config_hook is run twice."
-rw-r--r--tests/test_config.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/tests/test_config.c b/tests/test_config.c
index 8675cb890..d74726a1a 100644
--- a/tests/test_config.c
+++ b/tests/test_config.c
@@ -957,7 +957,8 @@ AST_TEST_DEFINE(config_hook)
{
enum ast_test_result_state res = AST_TEST_FAIL;
enum config_hook_flags hook_flags = { 0, };
- struct ast_flags config_flags = { CONFIG_FLAG_FILEUNCHANGED };
+ struct ast_flags config_flags = { 0 };
+ struct ast_flags reload_flags = { CONFIG_FLAG_FILEUNCHANGED };
struct ast_config *cfg;
switch (cmd) {
@@ -1025,7 +1026,7 @@ AST_TEST_DEFINE(config_hook)
* Hook should not run
*/
hook_run = 0;
- cfg = ast_config_load(CONFIG_FILE, config_flags);
+ cfg = ast_config_load(CONFIG_FILE, reload_flags);
/* Only destroy this cfg conditionally. Otherwise a crash happens. */
if (cfg != CONFIG_STATUS_FILEUNCHANGED) {
ast_config_destroy(cfg);