diff options
author | tilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b> | 2008-01-27 21:59:53 +0000 |
---|---|---|
committer | tilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b> | 2008-01-27 21:59:53 +0000 |
commit | 940f913146cc96cda9132600151d40ee85680ee6 (patch) | |
tree | a0610b66a954f2b2f98aedcd42cbc2b4250184b8 /main/dnsmgr.c | |
parent | 74e414e5f2dbf490e4c2f67ce638e0ec9e4ad0ae (diff) |
When deleting a task from the scheduler, ignoring the return value could
possibly cause memory to be accessed after it is freed, which causes all
sorts of random memory corruption. Instead, if a deletion fails, wait a
bit and try again (noting that another thread could change our taskid
value).
(closes issue #11386)
Reported by: flujan
Patches:
20080124__bug11386.diff.txt uploaded by Corydon76 (license 14)
Tested by: Corydon76, flujan, stuarth`
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@100465 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'main/dnsmgr.c')
-rw-r--r-- | main/dnsmgr.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/main/dnsmgr.c b/main/dnsmgr.c index f44751b97..5598523f8 100644 --- a/main/dnsmgr.c +++ b/main/dnsmgr.c @@ -252,7 +252,7 @@ static int refresh_list(const void *data) void dnsmgr_start_refresh(void) { if (refresh_sched > -1) { - ast_sched_del(sched, refresh_sched); + AST_SCHED_DEL(sched, refresh_sched); refresh_sched = ast_sched_add_variable(sched, 100, refresh_list, &master_refresh_info, 1); } } @@ -367,8 +367,7 @@ static int do_reload(int loading) was_enabled = enabled; enabled = 0; - if (refresh_sched > -1) - ast_sched_del(sched, refresh_sched); + AST_SCHED_DEL(sched, refresh_sched); if ((config = ast_config_load("dnsmgr.conf"))) { if ((enabled_value = ast_variable_retrieve(config, "general", "enable"))) { |