resolved: check return value of memdup() correctly for OOM

This commit is contained in:
Lennart Poettering 2020-11-03 18:06:47 +01:00
parent 8b2e362651
commit a63a1252b5

View File

@ -1650,7 +1650,7 @@ DnsResourceRecord *dns_resource_record_copy(DnsResourceRecord *rr) {
return NULL;
copy->nsec3.salt_size = rr->nsec3.salt_size;
copy->nsec3.next_hashed_name = memdup(rr->nsec3.next_hashed_name, rr->nsec3.next_hashed_name_size);
if (!copy->nsec3.next_hashed_name_size)
if (!copy->nsec3.next_hashed_name)
return NULL;
copy->nsec3.next_hashed_name_size = rr->nsec3.next_hashed_name_size;
copy->nsec3.types = bitmap_copy(rr->nsec3.types);