don't access freed memory if the frame was malloc'd