Fixes potential free-after-use in ipc module; closes #251.