fix memset

I think this will solve the null ptr problem