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

slist_delete() updates list pointer to wrong value #23

Closed
LeSpocky opened this issue May 9, 2016 · 0 comments · Fixed by #24
Closed

slist_delete() updates list pointer to wrong value #23

LeSpocky opened this issue May 9, 2016 · 0 comments · Fixed by #24
Assignees
Labels
Milestone

Comments

@LeSpocky
Copy link
Collaborator

LeSpocky commented May 9, 2016

The fix for #20 in a4f2e93 introduced a regression. The list pointer (**start) is not updated correctly anymore.

@LeSpocky LeSpocky added the bug label May 9, 2016
@LeSpocky LeSpocky added this to the v1.1 milestone May 9, 2016
@LeSpocky LeSpocky self-assigned this May 9, 2016
LeSpocky added a commit to LeSpocky/libcgi that referenced this issue May 10, 2016
The previous implementation had a serious flaw: the loop used **start as
iteration variable and changed it, so before each return we would have
to make sure it was set exactly right. Now we use a local iteration
variable and only touch **start and **last if necessary.

Additionally the memory of the deleted element is freed now. This was
not done before, but after removing the item from the list, there was no
way to ever release this memory anymore: memory leak!

The new implementation was tested with unit tests in a personal branch.

Fixes rafaelsteil#23.

Tested-by: Alexander Dahl <post@lespocky.de>
LeSpocky added a commit to LeSpocky/libcgi that referenced this issue Feb 24, 2017
The previous implementation had a serious flaw: the loop used **start as
iteration variable and changed it, so before each return we would have
to make sure it was set exactly right. Now we use a local iteration
variable and only touch **start and **last if necessary.

Additionally the memory of the deleted element is freed now. This was
not done before, but after removing the item from the list, there was no
way to ever release this memory anymore: memory leak!

The new implementation was tested with unit tests in a personal branch.

Fixes rafaelsteil#23.

Tested-by: Alexander Dahl <post@lespocky.de>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant