they give me function pointer for call back;
here is the func;
funcA(void* buffer,int size);
when i receive data i am goinf to call this func, buffer with data and
its size..
i have data listener thread; i receive data like this;
void* d = malloc(100);
recv(d,100);
then i call callback;
cb(d,100);
so; when we put this code in to a loop to receive&call continuesly,
a memory leak occurs... unless this buffer is not freed in callback
func.
Now i am free ing after calling callback... (after line cb(d,100); ),
i hesitate; is this the correct strategy....?