You can call the mysql_library_end() function to finalize the C API library.
Syntax
void
mysql_library_end(void)
Notes
Call this function when you finish using the library, for example, after disconnecting from the server. To avoid memory leaks, you must call mysql_library_end() explicitly so that memory management is performed to clear and release the resources occupied by the library.