diff options
author | mmichelson <mmichelson@f38db490-d61c-443f-a65b-d21fe96a405b> | 2009-04-08 16:52:03 +0000 |
---|---|---|
committer | mmichelson <mmichelson@f38db490-d61c-443f-a65b-d21fe96a405b> | 2009-04-08 16:52:03 +0000 |
commit | 07e3491172426653a0946a5d9fdf5a6a2f893a5a (patch) | |
tree | 7f62924d0095f905264e5432303bccd5ddae5dee | |
parent | d956c7e2c74d68a0244ea233182c4a74e01a46f3 (diff) |
Fix a small logical error when loading moh classes.
We were unconditionally incrementing the number of mohclasses
registered. However, we should actually only increment if the
call to moh_register was successful.
While this probably has never caused problems, I noticed it
and decided to fix it anyway.
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@187045 f38db490-d61c-443f-a65b-d21fe96a405b
-rw-r--r-- | res/res_musiconhold.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/res/res_musiconhold.c b/res/res_musiconhold.c index 95fe16ec2..33f258dc0 100644 --- a/res/res_musiconhold.c +++ b/res/res_musiconhold.c @@ -1219,9 +1219,9 @@ static int load_moh_classes(int reload) } /* Don't leak a class when it's already registered */ - moh_register(class, reload); - - numclasses++; + if (!moh_register(class, reload)) { + numclasses++; + } } |