Follow-up fix for #12152 from axeld suggestions
This commit is contained in:
parent
466081d08a
commit
6f5971cf52
@ -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;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user