From a63a1252b501f6c8b5a011825372977710e88e72 Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Tue, 3 Nov 2020 18:06:47 +0100 Subject: [PATCH] resolved: check return value of memdup() correctly for OOM --- src/resolve/resolved-dns-rr.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/resolve/resolved-dns-rr.c b/src/resolve/resolved-dns-rr.c index 9ca7ad96fd2..2db7ec4a0a0 100644 --- a/src/resolve/resolved-dns-rr.c +++ b/src/resolve/resolved-dns-rr.c @@ -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);