MySQL 9.5 C API Developer Guide
bool mysql_stmt_free_result(MYSQL_STMT *stmt)
          Releases memory associated with the result set produced by
          execution of the prepared statement. If there is a cursor open
          for the statement,
          mysql_stmt_free_result()
          closes it.