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