driver/main.c: use goto for clean up on errors