aboutsummaryrefslogtreecommitdiffstats
path: root/main/loader.c
diff options
context:
space:
mode:
authortilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b>2010-02-17 07:01:13 +0000
committertilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b>2010-02-17 07:01:13 +0000
commit7083ba0a45d0a1427aef42843fdbeedaf7210f6f (patch)
tree0bccd52447fd8522157a607bc1973401bf489dcd /main/loader.c
parenteae21bd2ffbe4dd555d4034aa12db55bf2ebbe8c (diff)
RTP documentation states that you can pass NULL as the module, so make sure that's really the case.
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@247125 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'main/loader.c')
-rw-r--r--main/loader.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/main/loader.c b/main/loader.c
index 99c9f124f..d8a9d6448 100644
--- a/main/loader.c
+++ b/main/loader.c
@@ -1200,6 +1200,10 @@ int ast_loader_unregister(int (*v)(void))
struct ast_module *ast_module_ref(struct ast_module *mod)
{
+ if (!mod) {
+ return NULL;
+ }
+
ast_atomic_fetchadd_int(&mod->usecount, +1);
ast_update_use_count();
@@ -1208,6 +1212,10 @@ struct ast_module *ast_module_ref(struct ast_module *mod)
void ast_module_unref(struct ast_module *mod)
{
+ if (!mod) {
+ return;
+ }
+
ast_atomic_fetchadd_int(&mod->usecount, -1);
ast_update_use_count();
}