Skip to content

Memory leak when using default allocator while doing a get request #96

@nhcoding4

Description

@nhcoding4

`
defer free_all(context.temp_allocator)
url := "https://cataas.com/cat"

response, client_err := client.get(url)
if client_err != nil {
fmt.printfln("Error getting from endpoint: %v err")
return
}
defer client.response_destroy(&response)
`
Loses 97 bytes @ odin-http-main/http.odin(165:11) (strings.clone in header_parse())
Clearing the context.temp_allocator used by the function still results in a leak.
Using an arena's allocator and freeing does not result in a leak.
Destroying/not destroying the body using the provided does not result in any change to the behaviour of the leak.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions