Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

[2.7] bpo-34395: Fix memory leaks caused by incautious usage of PyMem_Resize(). (GH-8756)#8785

Merged
serhiy-storchaka merged 5 commits into
python:2.7python/cpython:2.7from
sir-sigurd:bpo-34395-2.7sir-sigurd/cpython:bpo-34395-2.7Copy head branch name to clipboard
Aug 17, 2018
Merged

[2.7] bpo-34395: Fix memory leaks caused by incautious usage of PyMem_Resize(). (GH-8756)#8785
serhiy-storchaka merged 5 commits into
python:2.7python/cpython:2.7from
sir-sigurd:bpo-34395-2.7sir-sigurd/cpython:bpo-34395-2.7Copy head branch name to clipboard

Conversation

@sir-sigurd

@sir-sigurd sir-sigurd commented Aug 16, 2018

Copy link
Copy Markdown
Contributor

Comment thread Modules/_csv.c Outdated
if (self->field == NULL) {
char *field_new = self->field;
PyMem_Resize(field_new, char, field_size_new);
if (field == NULL) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be field_new.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, thanks.

@ZackerySpytz

Copy link
Copy Markdown
Contributor

Also, variables need to be declared at the top of blocks (for C89 compliance).

@serhiy-storchaka

Copy link
Copy Markdown
Member

It is possible to make the code in 2.7 simpler, but I prefer the similarity with 3.x.

@serhiy-storchaka

Copy link
Copy Markdown
Member

On other side, the 2.7 code already is too different from the 3.x code. So I have simplified it a bit.

@serhiy-storchaka serhiy-storchaka merged commit ae1f012 into python:2.7 Aug 17, 2018
@sir-sigurd sir-sigurd deleted the bpo-34395-2.7 branch August 17, 2018 05:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

skip news type-bug An unexpected behavior, bug, or error

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants

Morty Proxy This is a proxified and sanitized view of the page, visit original site.