summaryrefslogtreecommitdiff
path: root/main/loader.c
diff options
context:
space:
mode:
Diffstat (limited to 'main/loader.c')
-rw-r--r--main/loader.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/main/loader.c b/main/loader.c
index f9b2de943..44046ae2a 100644
--- a/main/loader.c
+++ b/main/loader.c
@@ -239,7 +239,9 @@ void __ast_module_user_hangup_all(struct ast_module *mod)
AST_LIST_LOCK(&mod->users);
while ((u = AST_LIST_REMOVE_HEAD(&mod->users, entry))) {
- ast_softhangup(u->chan, AST_SOFTHANGUP_APPUNLOAD);
+ if (u->chan) {
+ ast_softhangup(u->chan, AST_SOFTHANGUP_APPUNLOAD);
+ }
ast_atomic_fetchadd_int(&mod->usecount, -1);
ast_free(u);
}