]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
Asterisk 18103 - Fix reload crash caused by destroying default parking lot
authorJonathan Rose <jrose@digium.com>
Mon, 1 Aug 2011 21:08:10 +0000 (21:08 +0000)
committerJonathan Rose <jrose@digium.com>
Mon, 1 Aug 2011 21:08:10 +0000 (21:08 +0000)
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

index b57d7d137ce8298113386d72a9efa577aaecf57a..192198c566475f00d5af75bc97191c40a311cf8f 100644 (file)
@@ -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);
        }