From 92f490ca2a58684735024a50c42804434b09864f Mon Sep 17 00:00:00 2001 From: seanbright Date: Thu, 5 May 2011 20:27:25 +0000 Subject: Merged revisions 317370 via svnmerge from https://origsvn.digium.com/svn/asterisk/branches/1.8 ........ r317370 | seanbright | 2011-05-05 16:25:52 -0400 (Thu, 05 May 2011) | 10 lines 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: http://svn.digium.com/svn/asterisk/trunk@317377 f38db490-d61c-443f-a65b-d21fe96a405b --- addons/res_config_mysql.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'addons') diff --git a/addons/res_config_mysql.c b/addons/res_config_mysql.c index 50047008d..eaf7209f9 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); -- cgit v1.2.3