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

Session fixes #44

Merged
merged 4 commits into from
Jul 12, 2018
Merged

Session fixes #44

merged 4 commits into from
Jul 12, 2018

Conversation

LeSpocky
Copy link
Collaborator

These are from a tested personal branch to fix #25 and #33, includes some new tests.

LeSpocky added 4 commits July 12, 2018 19:46
This fixes a possible memory leak when working with sessions (especially
with some non-mainline fcgi patches). Quoting from the ticket:

The global variable `sess_fname` is a pointer to dynamically allocated
memory which happens either in `sess_generate_id()` or in
`cgi_session_start()`. However this memory is never freed.

To not expose the variable globally or even just to `cgi.c` where e.g.
`cgi_end()` could access it, a new API function is introduced. We leave
bumping the API version up to a follow up commit.

Fixes: rafaelsteil#25
Signed-off-by: Alexander Dahl <[email protected]>
The flag `sess_initialized` was never reset. After introducing
`cgi_session_free()` we can now reset it. While at it use `stdbool.h`
and make the variable a proper boolean, and also drop the not really
used `sess_finitialized` variable.

Fixes: rafaelsteil#33
Signed-off-by: Alexander Dahl <[email protected]>
This is a follow-up to rafaelsteil#25 to ensure this all works like it should
without evil memory leaks, null pointer dereferences, …

Now the first test here is very simple, just to get this test module
running.

Signed-off-by: Alexander Dahl <[email protected]>
@LeSpocky LeSpocky merged commit 54bfb46 into rafaelsteil:master Jul 12, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

possible memory leak with sessions
1 participant