Subj : Re: Segmentation fault when using malloc with threads To : comp.programming.threads From : Karthik007 Date : Sun Feb 27 2005 09:55 pm > if i use memcpy() function to copy the data pointed by > arg ("&data[cliNum]") into the memory pointed by "info" then this problem > can be solved i guess. Am i right in this regard ? >Yes, that's correct. >However, since you aready have the data[cliNum] >allocated, why do you feel you need >to 'malloc/memcpy/free', when you could just use >the original data[cliNum] ? Sir, when i am passing the structure in the thread handler fuction to other fuctions in the code and at that time when more than one client connects the data is being corrupted, so i am using malloc(). .