If an option is registered to a type and it is the last known type in the list
of registered types, and the option fails to register, an overrun of the types
array can occur due to the index variable having been already incremented.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@397568
65c4cc65-6c06-0410-ace0-
fbb531ad65f3
#endif /* AST_XML_DOCS */
) {
do {
- ao2_unlink(types[idx]->internal->opts, opt);
+ ao2_unlink(types[idx - 1]->internal->opts, opt);
} while (--idx);
return -1;
}