Fix a use-after-freed error introduced by previous attempt to fix a Coverity scan...