Fixes two reads from uninitialized memory and a double free on error condition in the genesys backend.