return cp;
}
-static int cf_data_free(void *ctx)
+static int _cf_data_free(CONF_DATA *cd)
{
- CONF_DATA *cd;
-
- cd = talloc_get_type_abort(ctx, CONF_DATA);
if (cd->free) {
cd->free(cd->data);
}
return strcmp(one->name, two->name);
}
-static int cf_section_free(void *ctx)
+static int _cf_section_free(CONF_SECTION *cs)
{
- CONF_SECTION *cs;
-
- cs = talloc_get_type_abort(ctx, CONF_SECTION);
-
/*
* Name1 and name2 are allocated contiguous with
* cs.
cs->pair_tree = rbtree_create(cs, pair_cmp, NULL, 0);
if (!cs->pair_tree) goto error;
- talloc_set_destructor((void *) cs, cf_section_free);
+ talloc_set_destructor(cs, _cf_section_free);
/*
* Don't create a data tree, it may not be needed.
cd->free = data_free;
if (cd->free) {
- talloc_set_destructor((void *) cd, cf_data_free);
+ talloc_set_destructor(cd, _cf_data_free);
}
return cd;
}
-static int listener_free(void *ctx)
+static int _listener_free(rad_listen_t *this)
{
- rad_listen_t *this;
-
- this = talloc_get_type_abort(ctx, rad_listen_t);
-
/*
* Other code may have eaten the FD.
*/
this->encode = master_listen[this->type].encode;
this->decode = master_listen[this->type].decode;
- talloc_set_destructor((void *) this, listener_free);
+ talloc_set_destructor(this, _listener_free);
this->data = talloc_zero_array(this, uint8_t, master_listen[this->type].inst_size);
}
}
-static int indexed_modcallable_free(indexed_modcallable *this)
+static int _indexed_modcallable_free(indexed_modcallable *this)
{
modcallable_free(&this->modulelist);
return 0;
/*
* Free a module entry.
*/
-static int module_entry_free(module_entry_t *this)
+static int _module_entry_free(module_entry_t *this)
{
#ifndef NDEBUG
/*
/* make room for the module type */
node = talloc_zero(cs, module_entry_t);
- talloc_set_destructor(node, module_entry_free);
+ talloc_set_destructor(node, _module_entry_free);
strlcpy(node->name, module_name, sizeof(node->name));
node->module = module;
node->handle = handle;
return NULL;
}
- talloc_set_destructor(c, indexed_modcallable_free);
+ talloc_set_destructor(c, _indexed_modcallable_free);
return c;
}
"failure"
};
-static int eap_module_free(void *ctx)
+static int _eap_module_free(eap_module_t *inst)
{
- eap_module_t *inst;
-
- inst = talloc_get_type_abort(ctx, eap_module_t);
-
/*
* We have to check inst->type as it's only allocated
* if we loaded the eap method.
*m_inst = method = talloc_zero(cs, eap_module_t);
if (!inst) return -1;
- talloc_set_destructor((void *) method, eap_module_free);
+ talloc_set_destructor(method, _eap_module_free);
/* fill in the structure */
method->cs = cs;
char *error;
} rlm_sql_db2_conn_t;
-static int sql_socket_destructor(void *c)
+static int _sql_socket_destructor(rlm_sql_db2_conn_t *conn)
{
- rlm_sql_db2_conn_t *conn = c;
-
DEBUG2("rlm_sql_db2: Socket destructor called, closing socket");
if (conn->hdbc) {
rlm_sql_db2_conn_t *conn;
MEM(conn = handle->conn = talloc_zero(handle, rlm_sql_db2_conn_t));
- talloc_set_destructor((void *) conn, sql_socket_destructor);
+ talloc_set_destructor(conn, _sql_socket_destructor);
/* allocate handles */
SQLAllocHandle(SQL_HANDLE_ENV, SQL_NULL_HANDLE, &(conn->henv));
static int sql_num_fields(rlm_sql_handle_t *handle, rlm_sql_config_t *config);
static sql_rcode_t sql_finish_query(rlm_sql_handle_t *handle, rlm_sql_config_t *config);
-static int sql_socket_destructor(void *c)
+static int _sql_socket_destructor(rlm_sql_firebird_conn_t *conn)
{
- rlm_sql_firebird_conn_t *conn = c;
int i;
DEBUG2("rlm_sql_firebird: socket destructor called, closing socket");
long res;
MEM(conn = handle->conn = talloc_zero(handle, rlm_sql_firebird_conn_t));
- talloc_set_destructor((void *) conn, sql_socket_destructor);
+ talloc_set_destructor(conn, _sql_socket_destructor);
res = fb_init_socket(conn);
if (res) {
}
-static int sql_socket_destructor(void *c)
+static int _sql_socket_destructor(rlm_sql_freetds_conn_t *conn)
{
- rlm_sql_freetds_conn_t *conn = c;
-
DEBUG2("rlm_sql_freetds: socket destructor called, closing socket");
if (conn->command) {
rlm_sql_freetds_conn_t *conn;
MEM(conn = handle->conn = talloc_zero(handle, rlm_sql_freetds_conn_t));
- talloc_set_destructor((void *) conn, sql_socket_destructor);
+ talloc_set_destructor(conn, _sql_socket_destructor);
/*
* Allocate a CS context structure. This should really only be done once, but because of
static char const *sql_error(rlm_sql_handle_t *handle, rlm_sql_config_t *config);
static int sql_num_fields(rlm_sql_handle_t *handle, rlm_sql_config_t *config);
-static int sql_socket_destructor(void *c)
+static int _sql_socket_destructor(rlm_sql_iodbc_conn_t *conn)
{
- rlm_sql_iodbc_conn_t *conn = c;
-
DEBUG2("rlm_sql_iodbc: Socket destructor called, closing socket");
if (conn->stmt_handle) {
SQLRETURN rcode;
MEM(conn = handle->conn = talloc_zero(handle, rlm_sql_iodbc_conn_t));
- talloc_set_destructor((void *) conn, sql_socket_destructor);
+ talloc_set_destructor(conn, _sql_socket_destructor);
rcode = SQLAllocEnv(&conn->env_handle);
if (!SQL_SUCCEEDED(rcode)) {
/* Prototypes */
static sql_rcode_t sql_free_result(rlm_sql_handle_t*, rlm_sql_config_t*);
-static int sql_socket_destructor(void *c)
+static int _sql_socket_destructor(rlm_sql_mysql_conn_t *conn)
{
- rlm_sql_mysql_conn_t *conn = c;
-
DEBUG2("rlm_sql_mysql: Socket destructor called, closing socket");
if (conn->sock){
unsigned long sql_flags;
MEM(conn = handle->conn = talloc_zero(handle, rlm_sql_mysql_conn_t));
- talloc_set_destructor((void *) conn, sql_socket_destructor);
+ talloc_set_destructor(conn, _sql_socket_destructor);
DEBUG("rlm_sql_mysql: Starting connect to MySQL server");
}
}
-static int sql_socket_destructor(void *c)
+static int _sql_socket_destructor(rlm_sql_oracle_conn_t *conn)
{
- rlm_sql_oracle_conn_t *conn = c;
-
if (conn->ctx) {
OCILogoff(conn->ctx, conn->error);
}
rlm_sql_oracle_conn_t *conn;
MEM(conn = handle->conn = talloc_zero(handle, rlm_sql_oracle_conn_t));
- talloc_set_destructor((void *) conn, sql_socket_destructor);
+ talloc_set_destructor(conn, _sql_socket_destructor);
/*
* Initialises the oracle environment
}
#endif
-static int sql_socket_destructor(void *c)
+static int _sql_socket_destructor(rlm_sql_postgres_conn_t *conn)
{
- rlm_sql_postgres_conn_t *conn = c;
-
DEBUG2("rlm_sql_postgresql: Socket destructor called, closing socket");
if (!conn->db) {
rlm_sql_postgres_conn_t *conn;
MEM(conn = handle->conn = talloc_zero(handle, rlm_sql_postgres_conn_t));
- talloc_set_destructor((void *) conn, sql_socket_destructor);
+ talloc_set_destructor(conn, _sql_socket_destructor);
DEBUG2("rlm_sql_postgresql: Connecting using parameters: %s", driver->db_string);
conn->db = PQconnectdb(driver->db_string);
return 0;
}
-static int sql_socket_destructor(void *c)
+static int _sql_socket_destructor(rlm_sql_sqlite_conn_t *conn)
{
int status = 0;
- rlm_sql_sqlite_conn_t * conn = c;
DEBUG2("rlm_sql_sqlite: Socket destructor called, closing socket");
int status;
MEM(conn = handle->conn = talloc_zero(handle, rlm_sql_sqlite_conn_t));
- talloc_set_destructor((void *) conn, sql_socket_destructor);
+ talloc_set_destructor(conn, _sql_socket_destructor);
INFO("rlm_sql_sqlite: Opening SQLite database \"%s\"", driver->filename);
#ifdef HAVE_SQLITE3_OPEN_V2
static int sql_affected_rows(rlm_sql_handle_t *handle, rlm_sql_config_t *config);
static int sql_num_fields(rlm_sql_handle_t *handle, rlm_sql_config_t *config);
-static int sql_socket_destructor(void *c)
+static int _sql_socket_destructor(rlm_sql_unixodbc_conn_t *conn)
{
- rlm_sql_unixodbc_conn_t *conn = c;
-
DEBUG2("rlm_sql_unixodbc: Socket destructor called, closing socket");
if (conn->statement) {
long err_handle;
MEM(conn = handle->conn = talloc_zero(handle, rlm_sql_unixodbc_conn_t));
- talloc_set_destructor((void *) conn, sql_socket_destructor);
+ talloc_set_destructor(conn, _sql_socket_destructor);
/* 1. Allocate environment handle and register version */
err_handle = SQLAllocHandle(SQL_HANDLE_ENV, SQL_NULL_HANDLE, &conn->env);
#ifdef HAVE_PTHREAD_H
#endif
-static int sql_conn_destructor(void *conn)
+static int _sql_conn_destructor(rlm_sql_handle_t *conn)
{
- rlm_sql_handle_t *handle = conn;
- rlm_sql_t *inst = handle->inst;
+ rlm_sql_t *inst = conn->inst;
rad_assert(inst);
* Then we call our destructor to trigger an modules.sql.close
* event, then all the memory is freed.
*/
- talloc_set_destructor((void *) handle, sql_conn_destructor);
+ talloc_set_destructor(handle, _sql_conn_destructor);
rcode = (inst->module->sql_socket_init)(handle, inst->config);
if (rcode != 0) {