remove memory leak in get_connection