mysql_free_result()

This frees the memory allocated to a result set. Here is its syntax:

void mysql_free_result(MYSQL_RES *resultset)

Here, resultset represents the set whose memory we want to free up.