r15834: fixed a memory leak in the session code