whitespace
Coverity doesn't like session->name staying set to track the last operation, try copying into a different field instead.
Coverity 1130767, don't leak memory on error.