mirror of
https://github.com/asterisk/asterisk.git
synced 2025-09-04 03:50:31 +00:00
config: Fix SEGV in unit test with MALLOC_DEBUG
With MALLOC_DEBUG the /main/config config_basic_ops test was causing a SEGV while doing an ast_category_delete in an ast_category_browse loop. Apparently this never worked but was also never tested. I removed the test, added 2 notes to config.h indicating that it's not supported and added a few lines of code to ast_category_delete to prevent the SEGV should someone attempt it in the future. Tested-by: George Joseph Review: https://reviewboard.asterisk.org/r/4078/ ........ Merged revisions 425525 from http://svn.asterisk.org/svn/asterisk/branches/12 ........ Merged revisions 425526 from http://svn.asterisk.org/svn/asterisk/branches/13 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@425527 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -1336,6 +1336,10 @@ struct ast_category *ast_category_delete(struct ast_config *config,
|
||||
|
||||
prev = category->prev;
|
||||
|
||||
if (config->last_browse == category) {
|
||||
config->last_browse = prev;
|
||||
}
|
||||
|
||||
ast_category_destroy(category);
|
||||
|
||||
return prev;
|
||||
|
Reference in New Issue
Block a user