Skip to content
This repository has been archived by the owner on Jun 15, 2020. It is now read-only.

netbuf memory leak #8

Open
FreddySpencer opened this issue Apr 27, 2018 · 0 comments
Open

netbuf memory leak #8

FreddySpencer opened this issue Apr 27, 2018 · 0 comments

Comments

@FreddySpencer
Copy link

FreddySpencer commented Apr 27, 2018

http_handle_connection():
the call netbuf_delete(inbuf) must be moved inside the while loop:

while (ctx->state != HTTP_REQUEST_DONE) {
    err = netconn_recv(conn, &inbuf);
    if (err != ERR_OK) {
        break;
    }

    err = netbuf_data(inbuf, (void**) &buf, &buflen);
    if (err != ERR_OK) {
        break;
    }

    size_t parsed_bytes = http_parser_execute(&ctx->parser, &parser_settings, buf, buflen);
    netbuf_delete(inbuf);
    if (parsed_bytes < buflen) {
        break;
    }
}
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant