From cdfeb4f406777632db5ddc09c90642383639a012 Mon Sep 17 00:00:00 2001 From: brain Date: Sun, 23 Jul 2006 15:46:13 +0000 Subject: [PATCH] Fixed to dynamically allocate the fieldlist git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@4530 e03df62e-2008-0410-955e-edbf42e46eb7 --- src/modules/extra/m_mysql.cpp | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/src/modules/extra/m_mysql.cpp b/src/modules/extra/m_mysql.cpp index 9c8e43a31..512780318 100644 --- a/src/modules/extra/m_mysql.cpp +++ b/src/modules/extra/m_mysql.cpp @@ -346,10 +346,16 @@ class MySQLresult : public SQLresult virtual SQLfieldList* GetRowPtr() { + SQLfieldList* fieldlist = new SQLfieldList(); + if (currentrow < rows) - return &fieldlists[currentrow++]; - else - return &emptyfieldlist; + { + for (int i = 0; i < Rows(); i++) + { + fieldlist->push_back(fieldlists[currentrow][i]); + } + } + return fieldlist; } virtual SQLfieldMap* GetRowMapPtr() @@ -380,6 +386,7 @@ class MySQLresult : public SQLresult * destruct the object. Unlike the pgsql module, * we only have the one. */ + delete fl; } }; -- 2.39.5