Fix two memory leaks found by Coverity (CIDs 417-418)