Fix memory corruptions.

Currently, set wrong pointer to make DATA type.
So, the access violation is happened when the wrong pointer is freed.