Fix #9213 ('bad_alloc' error at QGIS start)
Merge pull request #1157 from kiith-sa/master

Fix #9213 ('bad_alloc' error at QGIS start)