You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
This is not easy to solve. sess_fname is currently a static variable in session.c and the only API function exposed in the headers which could do this is cgi_end() which is implemented in cgi.c.
Exposing the variable globally: bad. Exposing the variable to cgi.c only: not possible without exposing it globally (?).
This whole concept of global variables in a library is broken, but for v1.x we can't change it anymore, if we want to maintain API compatibility.
I propose adding a new function like cgi_session_free() which does the cleanup.
Moved this to milestone v1.2, because introducing a new function would extend the API which would trigger a minor version bump with semantic versioning.
Activity
LeSpocky commentedon May 11, 2016
This is not easy to solve.
sess_fnameis currently a static variable insession.cand the only API function exposed in the headers which could do this iscgi_end()which is implemented incgi.c.Exposing the variable globally: bad. Exposing the variable to cgi.c only: not possible without exposing it globally (?).
This whole concept of global variables in a library is broken, but for v1.x we can't change it anymore, if we want to maintain API compatibility.
I propose adding a new function like
cgi_session_free()which does the cleanup.LeSpocky commentedon Feb 16, 2017
Moved this to milestone v1.2, because introducing a new function would extend the API which would trigger a minor version bump with semantic versioning.
Added API function to free session internals
Introduce tests for session
session: Added API function to free session internals
Introduce tests for session
Introduce tests for session
session: Added API function to free session internals
Introduce tests for session
session: Added API function to free session internals
Introduce tests for session
session: Added API function to free session internals
Introduce tests for session
session: Added API function to free session internals
Introduce tests for session
session: Added API function to free session internals
test: Introduce tests for session