Hey wait a minute. Where did you get the my_free(), may be you are trying to say mysql_free(), but then that is used only if result set is used/called.


But the code does not show any result set call. ie. mysql_use_result() or mysql_store_result().

So, the question now, how come there is a leak here. I dont see any, does anyone see any?

Chris Nolan wrote:

Hi!

You're looking for the function my_free(). Enjoy!

Regards,

Chris

John McCaskey wrote:

I have the following code:



//try the mysql connection

mysql_init(&mysql_connection);

if(!mysql_real_connect(&mysql_connection, db_host, db_user, db_pass,
db_db, 0, NULL, 0)) {


flockfile(stderr);

               fprintf(stderr, "%s: Failed to connect to database: Error:
%s\n", timestamp, mysql_error(&mysql_connection));

funlockfile(stderr);

mysql_close(&mysql_connection);

return(2);

}



mysql_close(&mysql_connection);



This code is creating a memory leak. Am I missing some cleanup calls? I'm
under the impression all I should need to do is call mysql_close to clean up
the connection? I'm testing this using mtrace, if I place a return directly
above the code segment it reports no leaks, if I place it direcly below the
fragment there are several variables reported as not being freed. Any
ideas?




John A. McCaskey









--


Aftab Jahan Subedar
CEO/Software Engineer
Subedar Technologies
Subedar Baag
Bibir Bagicha #1
North Jatrabari
Dhaka 1204
Bangladesh
http://www.SubedarTechnologies.com
http://www.DhakaStockExchangeGame.com/
http://www.CEOBangladesh.com/
http://www.NYSEGame.com
tel://+88027519050
EMail://[EMAIL PROTECTED] - Directly to my notebook



--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]



Reply via email to