passing constant zero as the length to memset
You called the C run-time library’s memset function with a zero character length. For example, memset(p,size,0). Instead, specify memset(p,0,size).