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/branches/1.4@187045
65c4cc65-6c06-0410-ace0-
fbb531ad65f3
}
/* Don't leak a class when it's already registered */
- moh_register(class, reload);
-
- numclasses++;
+ if (!moh_register(class, reload)) {
+ numclasses++;
+ }
}