From 09d8972be68d9104051641ea901ae6ad55e5e416 Mon Sep 17 00:00:00 2001 From: Anthony LaMantia Date: Wed, 13 Sep 2006 19:27:27 +0000 Subject: [PATCH] small fix for 7944 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@42891 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- main/loader.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/main/loader.c b/main/loader.c index 30f5aa6600..3b0005a6aa 100644 --- a/main/loader.c +++ b/main/loader.c @@ -199,6 +199,17 @@ struct ast_module_user *__ast_module_user_add(struct ast_module *mod, void __ast_module_user_remove(struct ast_module *mod, struct ast_module_user *u) { + + if (u <= 0) { + ast_log(LOG_ERROR,"ast_module_user invalid can not remove \n"); + return; + } + + if (mod <= 0) { + ast_log(LOG_ERROR,"ast_module invalid can not remove \n"); + return; + } + AST_LIST_LOCK(&mod->users); AST_LIST_REMOVE(&mod->users, u, entry); AST_LIST_UNLOCK(&mod->users);