char * buf = new char[sizeof(T)];
new (buf) T;
T * t = (T *)buf;
//code...
//here I should destruct *t but as it is argument of template and can be
//instantiated vi
The memory was actually allocated using char*; which you are properly freeing usingdelete[] buf. You just need to call the destructor t->~T() in this case for t. No need to delete t;.
Placementnew in this case, is used only to construct the object not for the memory allocation.