fix log memory leaks