Working with uint8_t*

Post you current complete code. I'm pretty sure there's no reason to use dynamic allocation and many reasons to avoid it.