Fix nonce1 and sessionid memory leak

Free the memory before set new value