void conn_free(connection_struct *conn) { /* Free vfs_connection_struct */ if (conn->dl_handle != NULL) { /* Close dlopen() handle */ sys_dlclose(conn->dl_handle); } DLIST_REMOVE(Connections, conn); if (conn->ngroups && conn->groups) { SAFE_FREE(conn->groups); conn->groups = NULL; conn->ngroups = 0; } delete_nt_token(&conn->nt_user_token); free_namearray(conn->veto_list); free_namearray(conn->hide_list); free_namearray(conn->veto_oplock_list); string_free(&conn->user); string_free(&conn->dirpath); string_free(&conn->connectpath); string_free(&conn->origpath); bitmap_clear(bmap, conn->cnum); num_open--; ZERO_STRUCTP(conn); SAFE_FREE(conn); }
static void atalk_add_to_list(name_compare_entry **list) { int i, count = 0; name_compare_entry *new_list = 0; name_compare_entry *cur_list = 0; cur_list = *list; if (cur_list) { for (i = 0, count = 0; cur_list[i].name; i ++, count ++) { if (strstr(cur_list[i].name, APPLEDOUBLE)) return; } } if (!(new_list = SMB_CALLOC_ARRAY(name_compare_entry, (count == 0 ? 1 : count + 1)))) return; for (i = 0; i < count; i ++) { new_list[i].name = SMB_STRDUP(cur_list[i].name); new_list[i].is_wild = cur_list[i].is_wild; } new_list[i].name = SMB_STRDUP(APPLEDOUBLE); new_list[i].is_wild = False; free_namearray(*list); *list = new_list; new_list = 0; cur_list = 0; }
void conn_free_internal(connection_struct *conn) { vfs_handle_struct *handle = NULL, *thandle = NULL; TALLOC_CTX *mem_ctx = NULL; /* Free vfs_connection_struct */ handle = conn->vfs_handles; while(handle) { DLIST_REMOVE(conn->vfs_handles, handle); thandle = handle->next; if (handle->free_data) handle->free_data(&handle->data); handle = thandle; } if (conn->ngroups && conn->groups) { SAFE_FREE(conn->groups); conn->ngroups = 0; } if (conn->nt_user_token) { TALLOC_FREE(conn->nt_user_token); } free_namearray(conn->veto_list); free_namearray(conn->hide_list); free_namearray(conn->veto_oplock_list); free_namearray(conn->aio_write_behind_list); string_free(&conn->user); string_free(&conn->dirpath); string_free(&conn->connectpath); string_free(&conn->origpath); mem_ctx = conn->mem_ctx; ZERO_STRUCTP(conn); talloc_destroy(mem_ctx); }
void conn_free(connection_struct *conn) { vfs_handle_struct *handle = NULL, *thandle = NULL; TALLOC_CTX *mem_ctx = NULL; /* Free vfs_connection_struct */ handle = conn->vfs_handles; while(handle) { DLIST_REMOVE(conn->vfs_handles, handle); thandle = handle->next; if (handle->free_data) handle->free_data(&handle->data); handle = thandle; } DLIST_REMOVE(Connections, conn); if (conn->ngroups && conn->groups) { SAFE_FREE(conn->groups); conn->ngroups = 0; } free_namearray(conn->veto_list); free_namearray(conn->hide_list); free_namearray(conn->veto_oplock_list); string_free(&conn->user); string_free(&conn->dirpath); string_free(&conn->connectpath); string_free(&conn->origpath); bitmap_clear(bmap, conn->cnum); num_open--; mem_ctx = conn->mem_ctx; ZERO_STRUCTP(conn); talloc_destroy(mem_ctx); }