summaryrefslogtreecommitdiff
path: root/include/asterisk/config.h
diff options
context:
space:
mode:
authorGeorge Joseph <george.joseph@fairview5.com>2014-10-14 20:48:06 +0000
committerGeorge Joseph <george.joseph@fairview5.com>2014-10-14 20:48:06 +0000
commit104fca50019a432886bfe79615b88122547d9f16 (patch)
tree4b88d7e4d5d2b00f45aa841da2a954ccb9e2ada7 /include/asterisk/config.h
parent87b5006ff06dd4a719dca96199e065437f31475d (diff)
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
Diffstat (limited to 'include/asterisk/config.h')
-rw-r--r--include/asterisk/config.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/include/asterisk/config.h b/include/asterisk/config.h
index 98cd71445..0919a58bc 100644
--- a/include/asterisk/config.h
+++ b/include/asterisk/config.h
@@ -257,6 +257,10 @@ char *ast_category_browse(struct ast_config *config, const char *prev_name);
*
* \retval ast_variable list on success
* \retval NULL on failure
+ *
+ * \note ast_category_browse is not thread safe and it is not safe to call
+ * ast_category_delete while browsing using ast_category_browse.
+ * ast_category_browse_filtered does not have these restrictions.
*/
struct ast_variable *ast_variable_browse_filtered(const struct ast_config *config,
const char *category_name, const char *filter);
@@ -794,6 +798,9 @@ int ast_category_insert(struct ast_config *config, struct ast_category *cat, con
* \param category category to delete
*
* \return the category after the deleted one which could be NULL.
+ *
+ * \note It is not safe to call ast_category_delete while browsing with
+ * ast_category_browse. It is safe with ast_category_browse_filtered.
*/
struct ast_category *ast_category_delete(struct ast_config *cfg, struct ast_category *category);