Ensure that logmsgs are freed properly