Memory Leak!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!11
HI Mario F.,
I have 2 catch statements within which 2 return statements are there.So should i need deallocate memory twice for your reference :
Code:
struct InstanceDataStruct *instanceData;
instanceData = (struct InstanceDataStruct*)malloc(sizeof InstanceDataStruct));
//some codes are there
//some codes are there
.......
.......
try
{
pthread_mutex_lock(&mutex);
setWSSecurity(siei_abus, sieiUserId, sieiPsw);
instanceData->client = new ATT::SIEIClient(sieiWsdl, siei_abus);
pthread_mutex_unlock(&mutex);
}
catch (IT_Bus::Exception& e) {
setStatus("ARPluginCreateInstance:", status, (char *) e.message());
pthread_mutex_unlock(&mutex);
return AR_RETURN_ERROR; // 1 return statement here
}
catch (...) {
pthread_mutex_unlock(&mutex);
return AR_RETURN_ERROR; //2 return statement here
}