]> git.ipfire.org Git - thirdparty/unbound.git/commitdiff
- auth-load-thread, fix memory leak on alloc failure when appending rrset
authorW.C.A. Wijngaards <wouter@nlnetlabs.nl>
Fri, 3 Jul 2026 14:39:28 +0000 (16:39 +0200)
committerW.C.A. Wijngaards <wouter@nlnetlabs.nl>
Fri, 3 Jul 2026 14:39:28 +0000 (16:39 +0200)
  copy for ixfr main zone data copy.

services/authload.c

index ea45ef1c55edd61aabd025a723feb506c944adcf..6ce62853beb44c442b008b0cf939aaebbd1318f2 100644 (file)
@@ -409,8 +409,10 @@ rrset_append_copy(struct auth_data* domain, struct auth_rrset* rrset,
        s->type = rrset->type;
        s->data = (struct packed_rrset_data*)memdup(rrset->data,
                packed_rrset_sizeof(rrset->data));
-       if(!s->data)
+       if(!s->data) {
+               free(s);
                return 0;
+       }
        packed_rrset_ptr_fixup(s->data);
        if(!*last)
                domain->rrsets = s;