you should assign NULL to msg in constructor
data() : msg( NULL ) {}