V
vivekian
Hi ,
Have the following piece of code ,
class ClientList {
public:
char * hostName ;
int portNo ;
struct timeval * tv ;
ClientList ()
{
this -> hostName = new char [40] ;
....
}
~ClientList ()
{
delete [] (this -> hostName) ;
}
};
While running , everything works fine and the destructor is called. But
it seems like the compiler tries to free this memory again on its own ,
giving the following error on g++
*** glibc detected *** double free or corruption (fasttop): 0x0804d008
***
is there something wrong which is being done here ?
thanks in advance .
Have the following piece of code ,
class ClientList {
public:
char * hostName ;
int portNo ;
struct timeval * tv ;
ClientList ()
{
this -> hostName = new char [40] ;
....
}
~ClientList ()
{
delete [] (this -> hostName) ;
}
};
While running , everything works fine and the destructor is called. But
it seems like the compiler tries to free this memory again on its own ,
giving the following error on g++
*** glibc detected *** double free or corruption (fasttop): 0x0804d008
***
is there something wrong which is being done here ?
thanks in advance .