mysql_free_result() crashes

mysql_free_result() crashes

am 20.09.2005 07:01:13 von Miguel Cardenas

Hello

I am a bit confused, have posted to the general list and still don't solve
this problem... it is simple, the mysql_free_result() C API function crashes
when I call it...

If I omit the call, the program works fine, but don't know if resources are
not being free after a query.

Explicitly the error returned after program abortion is this:

*** glibc detected *** double free or corruption (!prev): 0x08051d58 ***
Aborted

Is it a bug or should I omit the usage of this function on the latest version
of mysql? I saw the online manual and it says

---------------------------
23.2.3.25. mysql_free_result()

void mysql_free_result(MYSQL_RES *result)

Description

Frees the memory allocated for a result set by mysql_store_result(),
mysql_use_result(), mysql_list_dbs(), etc. When you are done with a result
set, you must free the memory it uses by calling mysql_free_result().
---------------------------

it says clearly "When you are done with a result set, you must free the memory
it uses by calling mysql_free_result()", so I suppose it is a must to call it
always after retrieving all rows.

Are there special conditions to use this function? I mean something like when
to use or not to use it? I already know that only SELECT and queries that
retrieve rows require to free resources, but maybe when all data is retrieved
the resources are free automatically, and when not all data is retrieved
(only the first records when mysql_use_result() is used) is by force?

I don't know if it is a bug or if I am making a mistake. Please let me know if
there are special conditions for the usage of this function that may not be
mentioned in the manual...

Thanks for any comment...


--
MySQL Bugs Mailing List
For list archives: http://lists.mysql.com/bugs
To unsubscribe: http://lists.mysql.com/bugs?unsub=gcdmb-bugs@m.gmane.org

Re: mysql_free_result() crashes

am 30.10.2005 15:55:58 von Valeriy Kravchuk

Hi Miguel,

If you have a repeatable test case, a set of SQL statements and C API
program with mysql_free_result() calls that give you a crash, please, report
it as a new bug at http://bugs.mysql.com.

For me mysql_free_result() works OK with 4..x and 5.0.x versions of MySQL.

Best regards,
--
Valeriy Kravchuk, Support Engineer
MySQL AB, Kiev, Ukraine, www.mysql.com

Are you MySQL certified? www.mysql.com/certification


--
MySQL Bugs Mailing List
For list archives: http://lists.mysql.com/bugs
To unsubscribe: http://lists.mysql.com/bugs?unsub=gcdmb-bugs@m.gmane.org