A
aj
I have the following snippet of code. On some platforms, the delete
calls works, on Linux, it core dumps (memory dump) at the delete
call. Am I responsible for deleting the memory that gethostbyname
allocated?
struct hostent *lHostInfo;
lHostInfo = gethostbyname(ipHost.c_str());
memcpy(&(lDestAddr.sin_addr), lHostInfo->h_addr_list[0], lHostInfo-
I am under the impression that you don't delete anything unless you
personally "new'ed" it. Is this theory correct in this situation?
calls works, on Linux, it core dumps (memory dump) at the delete
call. Am I responsible for deleting the memory that gethostbyname
allocated?
struct hostent *lHostInfo;
lHostInfo = gethostbyname(ipHost.c_str());
memcpy(&(lDestAddr.sin_addr), lHostInfo->h_addr_list[0], lHostInfo-
delete lHostInfo;h_length);
I am under the impression that you don't delete anything unless you
personally "new'ed" it. Is this theory correct in this situation?