Skip to content

Make sure the free'd lineptr doesn't leave a dangling pointer. #3098

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

Merged
merged 1 commit into from
Mar 24, 2015

Conversation

schveiguy
Copy link
Member

In #3089, a static buffer was introduced to help alleviate reallocating the getline buffer each call. However, in certain cases, the static buffer can be free'd, but not set to null. On a subsequent call to getline, realloc may be called on this invalid pointer. This PR simply nulls the pointer if it's free'd

@Hackerpilot
Copy link
Member

@andralex
Copy link
Member

super, thanks!

andralex added a commit that referenced this pull request Mar 24, 2015
Make sure the free'd lineptr doesn't leave a dangling pointer.
@andralex andralex merged commit f77b387 into dlang:master Mar 24, 2015
@schveiguy schveiguy deleted the fixreadlnmem branch March 24, 2015 11:37
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.

3 participants