From ccbc674e56b60ebedcb9b357d04ff0f63902588c Mon Sep 17 00:00:00 2001 From: Sean Bright Date: Thu, 5 May 2011 20:25:52 +0000 Subject: [PATCH] Don't duplicate our data on the stack and just use the MYSQL_ROW directly. With large result sets we were blowing out the stack. (closes issue #19090) Reported by: mickecarlsson Patches: issue19090_trunk_svn.patch uploaded by seanbright (license 71) Tested by: mickecarlsson git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@317370 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- addons/res_config_mysql.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/res_config_mysql.c b/addons/res_config_mysql.c index 50047008d0..eaf7209f93 100644 --- a/addons/res_config_mysql.c +++ b/addons/res_config_mysql.c @@ -398,7 +398,7 @@ static struct ast_variable *realtime_mysql(const char *database, const char *tab } else if (ast_strlen_zero(row[i])) { row[i] = " "; } - for (stringp = ast_strdupa(row[i]), chunk = strsep(&stringp, ";"); chunk; chunk = strsep(&stringp, ";")) { + for (stringp = row[i], chunk = strsep(&stringp, ";"); chunk; chunk = strsep(&stringp, ";")) { if (prev) { if ((prev->next = ast_variable_new(fields[i].name, decode_chunk(chunk), ""))) { prev = prev->next; @@ -524,7 +524,7 @@ static struct ast_config *realtime_multi_mysql(const char *database, const char for (i = 0; i < numFields; i++) { if (ast_strlen_zero(row[i])) continue; - for (stringp = ast_strdupa(row[i]), chunk = strsep(&stringp, ";"); chunk; chunk = strsep(&stringp, ";")) { + for (stringp = row[i], chunk = strsep(&stringp, ";"); chunk; chunk = strsep(&stringp, ";")) { if (chunk && !ast_strlen_zero(decode_chunk(ast_strip(chunk)))) { if (initfield && !strcmp(initfield, fields[i].name)) { ast_category_rename(cat, chunk); -- 2.47.3