Finishing up

Use the following functions to close a connection and deallocate the structures: