dbTalk Databases Forums  

Query leaking memory

mailing.database.mysql-plusplus mailing.database.mysql-plusplus


Discuss Query leaking memory in the mailing.database.mysql-plusplus forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
AT
 
Posts: n/a

Default Query leaking memory - 06-23-2006 , 02:25 PM






--------------030208010703070807090606
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit

Hi,


Inside Query there is a memory leak.
Please find the patch included that fixes this issue.

The reason is that you pass NOT the created memory, but the address of
the reference.


Greetings,
Steven

--------------030208010703070807090606
Content-Type: text/x-patch;
name="query_memleak.patch"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
filename="query_memleak.patch"

Index: query.cpp
================================================== =================
--- query.cpp (revision 64)
+++ query.cpp (working copy)
@@ -262,7 +262,7 @@
if (replace) {
S = *ss;
S.processed = true;
- return &S;
+ return ss;
}
else {
return ss;


--------------030208010703070807090606
Content-Type: text/plain; charset=us-ascii


--
MySQL++ Mailing List
For list archives: http://lists.mysql.com/plusplus
To unsubscribe: http://lists.mysql.com/plusplus?unsu...ie.nctu.edu.tw
--------------030208010703070807090606--

Reply With Quote
  #2  
Old   
AT
 
Posts: n/a

Default Re: Query leaking memory - 06-26-2006 , 01:25 PM






Steven Van Ingelgem wrote:
Quote:
Inside Query there is a memory leak.
Agreed.

Quote:
Please find the patch included that fixes this issue.
Sorry, that's not the right fix. That passes responsibility for freeing
the memory to code that doesn't do it, so your code still has a memory
leak. I've applied the correct one.

Thanks in any case for the hint.

--
MySQL++ Mailing List
For list archives: http://lists.mysql.com/plusplus
To unsubscribe: http://lists.mysql.com/plusplus?unsu...ie.nctu.edu.tw



Reply With Quote
  #3  
Old   
AT
 
Posts: n/a

Default Re: Query leaking memory - 06-26-2006 , 01:43 PM




Worked for me ... But happy it has been resolved anyway

Warren Young wrote:
Quote:
Steven Van Ingelgem wrote:

Inside Query there is a memory leak.

Agreed.

Please find the patch included that fixes this issue.

Sorry, that's not the right fix. That passes responsibility for
freeing the memory to code that doesn't do it, so your code still has
a memory leak. I've applied the correct one.

Thanks in any case for the hint.


--
MySQL++ Mailing List
For list archives: http://lists.mysql.com/plusplus
To unsubscribe: http://lists.mysql.com/plusplus?unsu...ie.nctu.edu.tw



Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.