Fix returning uninitialized variable (issue #8109).
Found by Christian with Coverity.