Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix some valgrind reported issues #560

Merged
merged 2 commits into from
Nov 8, 2022
Merged

Fix some valgrind reported issues #560

merged 2 commits into from
Nov 8, 2022

Conversation

okaestne
Copy link
Contributor

@okaestne okaestne commented Nov 5, 2022

This PR addresses two smaller issues that I found using valgrind:

  1. routing/Trie: use object references instead of raw pointers

    This way, we don't need to free the Trie when stopping the program (what we don't do right now).
    Also remove unused get_size method and simplify code a bit.

  2. http_connection: initialize task_id_

The former change addresses one of the leaks mentioned in #546. The other one, that is caused in do_accept by creating new Connection objects for every request seems to be harder to solve. This one should really be addressed, as it leaks around 5KB for every request.

@mrozigor mrozigor merged commit 84ec783 into CrowCpp:master Nov 8, 2022
@kwach
Copy link

kwach commented Jan 26, 2023

Is there anything prohibiting this PR to be accepted? I've hit mem and connection leaks as well and I'd be interested to see this merged :D

@okaestne okaestne deleted the fix-memleaks branch July 6, 2023 21:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants