I have a code here. I am using malloc to allocate memory to my struct. One member of this struct is assigned a string using StrDup inside a while loop though other members dont have to change their values. Now, as I am using StrDup, I have to clean memory otherwise there would be memory leaks but the cleaning of memory corrupts my struct malloc. What should I do? Thanks in Advance.
do
{
if( pURL == NULL )
break ;
pData->URL = StrDupA(pURL) ;
}while(pURL != NULL) ;