From 4424b26d1e85f5734ee58878fff5eaf075ff1f1f Mon Sep 17 00:00:00 2001 From: tilghman Date: Mon, 9 Nov 2009 07:37:52 +0000 Subject: Fix various problems detected with Valgrind. * chan_console accessed pvts after deallocation. * cdr_mysql stored a pointer that was freed by realloc() * The module loader did not check usecount on shutdown, which led to chan_iax2 reading a timer that was already unloaded. * The event subsystem sometimes creates an event with no IEs. Due to a corner condition, the code would read beyond the memory boundary. * res_pktccops did not correctly check whether its monitor thread was started. (closes issue #16062) Reported by: alexanderheinz Patches: 20091109__issue16062.diff.txt uploaded by tilghman (license 14) Tested by: tilghman git-svn-id: http://svn.digium.com/svn/asterisk/trunk@228798 f38db490-d61c-443f-a65b-d21fe96a405b --- addons/cdr_mysql.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'addons') diff --git a/addons/cdr_mysql.c b/addons/cdr_mysql.c index a6d37b31d..a7894acdc 100644 --- a/addons/cdr_mysql.c +++ b/addons/cdr_mysql.c @@ -364,16 +364,16 @@ static int my_load_config_string(struct ast_config *cfg, const char *category, c return -1; } + tmp = ast_variable_retrieve(cfg, category, variable); + + ast_str_set(field, 0, "%s", tmp ? tmp : def); + us->str = *field; AST_LIST_LOCK(&unload_strings); AST_LIST_INSERT_HEAD(&unload_strings, us, entry); AST_LIST_UNLOCK(&unload_strings); - tmp = ast_variable_retrieve(cfg, category, variable); - - ast_str_set(field, 0, "%s", tmp ? tmp : def); - return 0; } -- cgit v1.2.3