From 356baaba351a5a3875d6521f050f364bd476499a Mon Sep 17 00:00:00 2001 From: Jonathan Rose Date: Mon, 1 Aug 2011 21:08:10 +0000 Subject: [PATCH] Asterisk 18103 - Fix reload crash caused by destroying default parking lot Default parking lot was being destroyed in reload and was not being rebuilt properly. This patch keeps features.c reload from destroying the default parking lot in 1.6.2. Bug was caused by a hasty backport which didn't test reload enough times to catch the problem. (closes issue ASTERISK-18103) Reported by: 808blogger Review: https://reviewboard.asterisk.org/r/1337/ git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.6.2@330490 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- main/features.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/main/features.c b/main/features.c index b57d7d137c..192198c566 100644 --- a/main/features.c +++ b/main/features.c @@ -4251,8 +4251,10 @@ static int load_config(void) struct ast_parkinglot *p; struct ao2_iterator iter = ao2_iterator_init(parkinglots, 0); while ((p = ao2_iterator_next(&iter))) { - ao2_unlink(parkinglots, p); - ao2_ref(p,-1); + if (p != default_parkinglot) { + ao2_unlink(parkinglots, p); + ao2_ref(p,-1); + } } ao2_iterator_destroy(&iter); }