KSQL_FREE(3)

NAME
ksql_free - free a ksql database handle

LIBRARY
ksql

SYNOPSIS
#include <ksql.h>
enum ksqlc
ksql_free(struct ksql *sql);

DESCRIPTION
The ksql_free function frees a database handle sql, previously allocated with ksql_alloc(3). This internally invokes ksql_close(3) then frees all internal memory. If the handle was allocated with KSQL_SAFE_EXIT, the handle is removed from the queue of handles that would be freed on exit (so it is not double-freed).

This function is invoked from the atexit(3) handler if KSQL_SAFE_EXIT was specified and the handle was not freed prior to exiting. In this case, the KSQL_EXIT_ON_ERR flag is temporarily suppressed.

RETURN VALUES
This returns the error code of ksql_close(3).