I think it's better to use smart pointer that can properly delete char array.