Follow-up fix for #12152 from axeld suggestions

This commit is contained in:
Dario Casalinuovo 2016-01-06 12:46:22 +01:00
parent 466081d08a
commit 6f5971cf52

View File

@ -409,16 +409,8 @@ InterfaceAddress::Prepare(sockaddr** _address, size_t size)
sockaddr* address = *_address;
if (address == NULL || size > address->sa_len) {
sockaddr* resized = (sockaddr*)realloc(address, size);
if (resized == NULL) {
free(address);
return NULL;
}
address = resized;
}
if (address == NULL || size > address->sa_len)
address = (sockaddr*)realloc(address, size);
address->sa_len = size;