Skip to content

cb_arg memory leak in evhttp_request_set_on_complete_cb  #643

@imay

Description

@imay

we use complete callback to free our handler context. we pass the context to cb_arg through evhttp_request_set_on_complete_cb function.

However, when I read the http.c source code, I found that on_complete wouldn't be called in some case.

In evhttp_connection_incoming_fail function, if error parameter is EVREQ_HTTP_TIMEOUT or EVREQ_HTTP_EOF, function just free evhttp_request without call on_complete. Then the passed cb_arg
is leak.

I want to know is there any method to avoid memory leak?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions