Coverity fix: check return type