macosx: fixes a memory leak.