fixed usage of memset for heap allocated array