Skip to content

Free regex_t.#216

Merged
kmroz merged 1 commit intomainfrom
215-free-regex-memory
Aug 31, 2023
Merged

Free regex_t.#216
kmroz merged 1 commit intomainfrom
215-free-regex-memory

Conversation

@bartossh
Copy link
Copy Markdown
Owner

@kmroz sorry I missed that part when reviewing PR, as I am not a regex guy 🤓. It looks like we have to free the memory of the regex after using it.
Because it is used only when checking a config I will not move it into the separate method (function on the first param being some structure holding the pointer to regex_t). It is unnecessary. Instead, I clean it after using it. Simple.

  • There is a command provided in the makefile allowing to check memory sanitization:
make memcheck

The above will do the trick and print all allocations that are not freed.

@bartossh bartossh linked an issue Aug 31, 2023 that may be closed by this pull request
@bartossh bartossh self-assigned this Aug 31, 2023
Copy link
Copy Markdown
Collaborator

@kmroz kmroz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome... thanks!

@kmroz kmroz merged commit 2d5585d into main Aug 31, 2023
@kmroz kmroz deleted the 215-free-regex-memory branch August 31, 2023 06:10
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.

Free regex memory.

2 participants