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








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



Reply via email to