mysql_free_result()
void mysql_free_result(MYSQL_RES *result)
Use this to free memory allocated by a function such as
mysql_store_result() in which a
MYSQL_RES element was employed to store a results
set. Here is an example:
... result = mysql_query(mysql, sql_stmnt); ... mysql_free_result(result); ...
Not freeing allocated memory or attempting to access allocated memory after it’s freed can cause problems.