When failing to configure, don't destroy 'cfg' twice