Fix memory leak in error path, spotted by Martin Zielinski <mz@seh.de>.