summaryrefslogtreecommitdiff
path: root/src/modules/extra
diff options
context:
space:
mode:
authorbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2006-07-23 15:46:13 +0000
committerbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2006-07-23 15:46:13 +0000
commitcdfeb4f406777632db5ddc09c90642383639a012 (patch)
treee20274c2535d4489ee24b7364f7ab5ee374e124c /src/modules/extra
parent4d0cd408dfabdcd0b95b5305e47a594ff958c74a (diff)
Fixed to dynamically allocate the fieldlist
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@4530 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/modules/extra')
-rw-r--r--src/modules/extra/m_mysql.cpp13
1 files 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;
}
};