free buffer in log functions