diff options
author | Mark Michelson <mmichelson@digium.com> | 2009-04-08 16:52:20 +0000 |
---|---|---|
committer | Mark Michelson <mmichelson@digium.com> | 2009-04-08 16:52:20 +0000 |
commit | da786078f307e8e006ac19ce12b03469181ee65c (patch) | |
tree | d9f1b118bc5bd7ec1e5e61be774ed4646a38009c /res/res_musiconhold.c | |
parent | 0ab599bf942f4bdd82a2416e9170a545cac484ca (diff) |
Merged revisions 187045 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4
........
r187045 | mmichelson | 2009-04-08 11:52:03 -0500 (Wed, 08 Apr 2009) | 10 lines
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: https://origsvn.digium.com/svn/asterisk/trunk@187046 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'res/res_musiconhold.c')
-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 c6cfb9672..39d475f12 100644 --- a/res/res_musiconhold.c +++ b/res/res_musiconhold.c @@ -1505,9 +1505,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++; + } } ast_config_destroy(cfg); |