fix reinit connections, add qs_memory_alloc