Revert "Proposed fix for coverity #29372" because of causing Segmentation