Skip to content
HttpHeaderDeinit

HttpHeaderDeinit

Description

User-facing deinit. Releases the backing storage owned by header->key and header->value, then zeros the struct.

Success

Returns to the caller. *header is zeroed.

Failure

Aborts via LOG_FATAL when header is NULL.

Usage example (Cross-references)

Usage examples (Cross-references)
    // ---------------------------------------------------------------------------
    
    void HttpHeaderDeinit(HttpHeader *header) {
        if (!header) {
            LOG_FATAL("invalid arguments");
            if (cursor == line_start) {
                LOG_ERROR("failed to parse header line");
                HttpHeaderDeinit(&hh);
                return in;
            }
    
            if (!VecPushBackL(&req->headers, hh)) {
                HttpHeaderDeinit(&hh);
                LOG_ERROR("failed to push header");
                return in;
        // R-push deep-copied into the vec and left `hh` owning its own storage;
        // reclaim the source so only the vec's deep copies remain live.
        HttpHeaderDeinit(&hh);
        ok = ok && (DebugAllocatorLiveCount(&dbg) > 0);
Last updated on