summaryrefslogtreecommitdiff
path: root/main/asterisk.c
diff options
context:
space:
mode:
authorCorey Farrell <git@cfware.com>2015-05-01 14:22:03 -0400
committerCorey Farrell <git@cfware.com>2015-05-01 15:40:45 -0400
commit5875bf183c255f19ededdb1004f35fd15cd1e6cf (patch)
tree31ad8c8b70393de7f826f634795c339056c98192 /main/asterisk.c
parentec0f80b6e8d5f6952bdf48e8f19a024ebc64840e (diff)
Astobj2: Fix initialization order of refdebug and AO2_DEBUG.
This ensures that refdebug is initialized before AO2_DEBUG if both are enabled, since AO2_DEBUG allocates a container. This change also makes AO2_DEBUG initialization critical, a failure will abort Asterisk startup. This is needed since the failure would be caused by reg_containers allocation failure, and that would result in a segmentation fault by ao2_container_register later in startup. ASTERISK-25048 #close Reported by: Corey Farrell Change-Id: I9a243ea3fc5653b48b931ba6d61971cb2e530244
Diffstat (limited to 'main/asterisk.c')
-rw-r--r--main/asterisk.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/main/asterisk.c b/main/asterisk.c
index 2b70a99b0..137ee9315 100644
--- a/main/asterisk.c
+++ b/main/asterisk.c
@@ -4353,7 +4353,10 @@ int main(int argc, char *argv[])
register_config_cli();
read_config_maps();
- astobj2_init();
+ if (astobj2_init()) {
+ printf("Failed: astobj2_init\n%s", term_quit());
+ exit(1);
+ }
if (ast_opt_console) {
if (el_hist == NULL || el == NULL)