rhbz#1057977 avoid use of invalidated pointers

Change-Id: Ib81f79da696b5e8002f5a2ddcf160903231dc3f1