aboutsummaryrefslogtreecommitdiffstats
path: root/res/res_musiconhold.c
diff options
context:
space:
mode:
authormmichelson <mmichelson@f38db490-d61c-443f-a65b-d21fe96a405b>2009-04-08 16:54:09 +0000
committermmichelson <mmichelson@f38db490-d61c-443f-a65b-d21fe96a405b>2009-04-08 16:54:09 +0000
commitfcff597d10076b3eaf58ae737a72416797f1295d (patch)
tree7f52a672dcf0a7960c2799da781f06fef3a901a3 /res/res_musiconhold.c
parent6a6da336441a5b79681024e70d88b7eba063ec74 (diff)
Merged revisions 187046 via svnmerge from
https://origsvn.digium.com/svn/asterisk/trunk ................ r187046 | mmichelson | 2009-04-08 11:52:20 -0500 (Wed, 08 Apr 2009) | 16 lines 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: http://svn.digium.com/svn/asterisk/branches/1.6.2@187049 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'res/res_musiconhold.c')
-rw-r--r--res/res_musiconhold.c6
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);