How bad it is to keep calling malloc() and free()?
I’m sending a text file – client-server
breakup the text into packets each of 512 bytes
but some packets contain text less than max size so on the servers side when receiving each packet I’m calling malloc() to build a string again , is this a bad practice ?
is it better to keep a working buffer that can fit for max length and keep iterating , copying and overwriting its values ?