Memory allocation issue detected by coverity CID 25812
Merge pull request #2146 from tklein23/coverity_error_cid_25812

Memory allocation issue detected by coverity CID 25812