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

http://hub.qgis.org/issues/9213