Skip to content
DnsRecordDeinit

DnsRecordDeinit

Description

Release the owned string / Vec slots inside a single DnsRecord. Used both by DnsResponseDeinit (per-record) and by callers that build records by hand.

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)
            DnsRecord rec = {0};
            if (!decode_record(it, &rec, alloc)) {
                DnsRecordDeinit(&rec);
                return false;
            }
            // push-failure path would orphan their backing allocations.
            if (!VecPushBackR(out, rec)) {
                DnsRecordDeinit(&rec);
                return false;
            }
    // ---------------------------------------------------------------------------
    
    void DnsRecordDeinit(DnsRecord *self) {
        if (!self) {
            return;
        }
        VecForeachPtr(list, r) {
            DnsRecordDeinit(r);
        }
        VecDeinit(list);
Last updated on