eventRecord.cu: fix allocation bug, memory leak