Skip to content

possible memory leak with sessions #25

Closed

Description

@LeSpocky

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.

Activity

  1. added this to the v1.1 milestone on May 10, 2016
  2. self-assigned this
    on May 10, 2016
  3. LeSpocky commented on May 11, 2016

    @LeSpocky
    CollaboratorAuthor

    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.

  4. modified the milestones: v1.1.1, v1.1 on May 18, 2016
  5. modified the milestones: , v1.1.1 on Feb 16, 2017
  6. LeSpocky commented on Feb 16, 2017

    @LeSpocky
    CollaboratorAuthor

    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.

  7. added 5 commits that reference this issue on Feb 16, 2017
    228d555
    f60ab07
    8b793ef
    9a23e48
    97cbe52
  8. added 6 commits that reference this issue on Jul 12, 2018
    163a31f
    bb8a4d8
    49d7340
    2390aee
    1ca33a0
    5d67511
  9. added 4 commits that reference this issue on Jul 12, 2018
    4589ded
    b3a3b3e
    9531f70
    b59c3c4
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions