Bug 1240515 - change allocator for addr and localaddr from malloc to new, since the smart pointer that is used uses delete operator. r=dragana
--- a/netwerk/system/linux/nsNotifyAddrListener_Linux.cpp
+++ b/netwerk/system/linux/nsNotifyAddrListener_Linux.cpp
@@ -189,31 +189,31 @@ void nsNotifyAddrListener::OnNetlinkMess
attr = IFA_RTA (newifam);
attr_len = IFA_PAYLOAD (nlh);
for (;attr_len && RTA_OK (attr, attr_len);
attr = RTA_NEXT (attr, attr_len)) {
if (attr->rta_type == IFA_ADDRESS) {
if (newifam->ifa_family == AF_INET) {
struct in_addr* in = (struct in_addr*)RTA_DATA(attr);
- addr = (char*)malloc(INET_ADDRSTRLEN);
+ addr = new char[INET_ADDRSTRLEN];
inet_ntop(AF_INET, in, addr.get(), INET_ADDRSTRLEN);
} else {
struct in6_addr* in = (struct in6_addr*)RTA_DATA(attr);
- addr = (char*)malloc(INET6_ADDRSTRLEN);
+ addr = new char[INET6_ADDRSTRLEN];
inet_ntop(AF_INET6, in, addr.get(), INET6_ADDRSTRLEN);
}
} else if (attr->rta_type == IFA_LOCAL) {
if (newifam->ifa_family == AF_INET) {
struct in_addr* in = (struct in_addr*)RTA_DATA(attr);
- localaddr = (char*)malloc(INET_ADDRSTRLEN);
+ localaddr = new char[INET_ADDRSTRLEN];
inet_ntop(AF_INET, in, localaddr.get(), INET_ADDRSTRLEN);
} else {
struct in6_addr* in = (struct in6_addr*)RTA_DATA(attr);
- localaddr = (char*)malloc(INET6_ADDRSTRLEN);
+ localaddr = new char[INET6_ADDRSTRLEN];
inet_ntop(AF_INET6, in, localaddr.get(), INET6_ADDRSTRLEN);
}
}
}
if (localaddr) {
addr = localaddr;
}
if (!addr) {