Fixed memleaks in IPC server.