When shutting down, the cleanup path should not try to destroy 'newnodes', because it is NULL at that point. Introduce another label for the "shuttingdown" scenario.
When shutting down, the cleanup path should not try to destroy 'newnodes', because it is NULL at that point. Introduce another label for the "shuttingdown" scenario.