Fix a segmentation fault

There is a bug in clearing an array using memset.

Fix it by assigning correct value to the third parameter of memset.