From 8ec6e19c86d082228ca26a21a4e442fd6ae4ec86 Mon Sep 17 00:00:00 2001 From: Joshua Elson Date: Thu, 4 May 2017 18:28:55 -0400 Subject: [PATCH] Prevent Undefined Capath Crash It is possible to initialize a valid config without a capath or cafile definition. This will cause a crash on a reload. This fix ensures capath is always allocated. ASTERISK-26983 #close Change-Id: I63ff715d9d9023427543a5b8a4ba7b0d82533c12 --- main/manager.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/main/manager.c b/main/manager.c index 0ea6bfae45..6f57f056ed 100644 --- a/main/manager.c +++ b/main/manager.c @@ -8723,6 +8723,10 @@ static void manager_shutdown(void) ami_tls_cfg.pvtfile = NULL; ast_free(ami_tls_cfg.cipher); ami_tls_cfg.cipher = NULL; + ast_free(ami_tls_cfg.cafile); + ami_tls_cfg.cafile = NULL; + ast_free(ami_tls_cfg.capath); + ami_tls_cfg.capath = NULL; ao2_global_obj_release(mgr_sessions); @@ -8823,6 +8827,10 @@ static void manager_set_defaults(void) ami_tls_cfg.pvtfile = ast_strdup(""); ast_free(ami_tls_cfg.cipher); ami_tls_cfg.cipher = ast_strdup(""); + ast_free(ami_tls_cfg.cafile); + ami_tls_cfg.cafile = ast_strdup(""); + ast_free(ami_tls_cfg.capath); + ami_tls_cfg.capath = ast_strdup(""); } static int __init_manager(int reload, int by_external_config)