diff options
author | Matthew Jordan <mjordan@digium.com> | 2013-12-08 05:59:46 +0000 |
---|---|---|
committer | Matthew Jordan <mjordan@digium.com> | 2013-12-08 05:59:46 +0000 |
commit | eb4aa1f0a8f8111f2607b4e8e207be3b41cf62fe (patch) | |
tree | 8c2adfef5a8690cf3f4eddf5ab66c1c083dcf2a6 /res/res_config_sqlite.c | |
parent | ae92549c934d80d70309f26f758afc3d7910bc07 (diff) |
res_config_sqlite: Check for CDR unregistration failures
If the CDR unregistration fails due to an inflight CDR, the
res_config_sqlite module needs to bail on unloading itself. Otherwise,
the config could be unloaded (including the CDR table name) while the
CDR engine posts a CDR to the still registered backend, resulting in
a crash.
........
Merged revisions 403435 from http://svn.asterisk.org/svn/asterisk/branches/12
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@403436 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'res/res_config_sqlite.c')
-rw-r--r-- | res/res_config_sqlite.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/res/res_config_sqlite.c b/res/res_config_sqlite.c index 7d5fd83e6..143f4ea50 100644 --- a/res/res_config_sqlite.c +++ b/res/res_config_sqlite.c @@ -1627,11 +1627,13 @@ static char *handle_cli_sqlite_show_tables(struct ast_cli_entry *e, int cmd, str static int unload_module(void) { - if (cli_status_registered) - ast_cli_unregister_multiple(cli_status, ARRAY_LEN(cli_status)); + if (cdr_registered && ast_cdr_unregister(RES_CONFIG_SQLITE_NAME)) { + return -1; + } - if (cdr_registered) - ast_cdr_unregister(RES_CONFIG_SQLITE_NAME); + if (cli_status_registered) { + ast_cli_unregister_multiple(cli_status, ARRAY_LEN(cli_status)); + } ast_config_engine_deregister(&sqlite_engine); |