Skip to content
DnsResponseDeinit

DnsResponseDeinit

Description

Release every owned string / Vec inside a parsed DnsResponse.

Success

Returns to the caller. *self is zeroed.

Failure

Function cannot fail. NULL self is a no-op.

Usage example (Cross-references)

Usage examples (Cross-references)
        bool ok = DnsParseResponse(&resp, resp_buf, (u64)got, ALLOCATOR_OF(&scratch));
        if (!ok || resp.id != id || resp.rcode != DNS_RCODE_NOERROR) {
            DnsResponseDeinit(&resp);
            ArenaAllocatorDeinit(&scratch);
            return false;
            }
        }
        DnsResponseDeinit(&resp);
        ArenaAllocatorDeinit(&scratch);
        return found;
    }
    
    void DnsResponseDeinit(DnsResponse *self) {
        if (!self) {
            return;
        }
    
        DnsResponseDeinit(&resp);
        DefaultAllocatorDeinit(&alloc);
        return match;
        bool        match = ok && resp.rcode == DNS_RCODE_NXDOMAIN && VecLen(&resp.answers) == 0;
    
        DnsResponseDeinit(&resp);
        DefaultAllocatorDeinit(&alloc);
        return match;
        }
    
        DnsResponseDeinit(&resp);
        DefaultAllocatorDeinit(&alloc);
        return match;
Last updated on