diff options
author | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2006-07-23 15:46:13 +0000 |
---|---|---|
committer | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2006-07-23 15:46:13 +0000 |
commit | cdfeb4f406777632db5ddc09c90642383639a012 (patch) | |
tree | e20274c2535d4489ee24b7364f7ab5ee374e124c /src | |
parent | 4d0cd408dfabdcd0b95b5305e47a594ff958c74a (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')
-rw-r--r-- | src/modules/extra/m_mysql.cpp | 13 |
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; } }; |