summaryrefslogtreecommitdiff
path: root/res/res_pjsip_outbound_registration.c
diff options
context:
space:
mode:
authorJoshua Colp <jcolp@digium.com>2015-01-15 12:09:40 +0000
committerJoshua Colp <jcolp@digium.com>2015-01-15 12:09:40 +0000
commitc95391f23ccc30e7d495a16ef927846dab96984a (patch)
treed037f5d06b841129d3fe16de239f657a308f2175 /res/res_pjsip_outbound_registration.c
parentf6630e248124bf34683d20f829d63a9b6dfc8c79 (diff)
res_pjsip_outbound_registration: Fix race condition when reloading and listing registrations.
Due to the split of outbound registration state from configuration it is possible during a reload for a "pjsip show registrations" CLI command to be executed which gets an older snapshot of the configuration. This configuration may include outbound registrations which have been removed due to a reload operation occurring at the same time. The code for printing the outbound registration did not take this into account but now it does. AST-1506 #close Review: https://reviewboard.asterisk.org/r/4338/ git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/13@430664 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'res/res_pjsip_outbound_registration.c')
-rw-r--r--res/res_pjsip_outbound_registration.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/res/res_pjsip_outbound_registration.c b/res/res_pjsip_outbound_registration.c
index b06e3d33a..aac0eb1f9 100644
--- a/res/res_pjsip_outbound_registration.c
+++ b/res/res_pjsip_outbound_registration.c
@@ -1422,6 +1422,10 @@ static int cli_print_body(void *obj, void *arg, int flags)
ast_assert(context->output_buffer != NULL);
+ if (!state) {
+ return 0;
+ }
+
ast_str_append(&context->output_buffer, 0, " %-s/%-*.*s %-16s %-16s\n",
id,
(int) (REGISTRATION_URI_FIELD_LEN - strlen(id)),