|
-
Jul 14th, 2003, 10:54 AM
#1
Thread Starter
Lively Member
The buffer when using recv
Hi.
All examples I have seen that use recv (in C wich is what I use) has had the buffer (that is filled up with recv) declared as:
char buffer[256];
I have done the following:
char *buffer=NULL;
buffer=malloc((BUFFSIZE)*sizeof(char));
and it all seem to work fine until the end of my function where I try to free the allocated memory with:
free(buffer);
Then the program buggs out on me.
Since I´m running MS VC++ I´ve done some debugging on it but haven´t found out why this is happeninig. buffer is allocated and contains info when trying to do the free().
So I wonder if it might be so that recv messes up my allocated buffer since I did get it thru malloc?
Or do anyone have another point of view?
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|