Skip to content

Objective-C: Fix memory leak of every message sent#8790

Merged
jcanizales merged 1 commit intogrpc:masterfrom
pquerna:objc_fix_leak_of_buffer
Dec 5, 2016
Merged

Objective-C: Fix memory leak of every message sent#8790
jcanizales merged 1 commit intogrpc:masterfrom
pquerna:objc_fix_leak_of_buffer

Conversation

@pquerna
Copy link
Copy Markdown
Contributor

@pquerna pquerna commented Nov 18, 2016

GPR Buffers need to be destroyed, not directly freed, otherwise it leaks the reference counted backing slices.

Hard to validate for me on macOS right now due to #8766

@grpc-kokoro
Copy link
Copy Markdown
Collaborator

Thanks for your pull request. The automated tests will run as soon as one of the admins verifies this change is ok for us to run on our infrastructure.

@murgatroid99
Copy link
Copy Markdown
Member

this is ok to test

@pquerna
Copy link
Copy Markdown
Contributor Author

pquerna commented Nov 28, 2016

cc @jcanizales


- (void)dealloc {
gpr_free(_op.data.send_message);
grpc_slice_buffer_destroy(_op.data.send_message);
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.

_op.data.send_message needs to be a grpc_byte_buffer. Looking at its definition, the slice buffer is encapsulated within it. So I assume grpc_byte_buffer_destroy will take care of it, and is the right choice here.

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.

Yup. Fixed and rebased on current master.

@pquerna pquerna force-pushed the objc_fix_leak_of_buffer branch from 75341ba to d907370 Compare December 5, 2016 16:38
Copy link
Copy Markdown
Contributor

@muxi muxi left a comment

Choose a reason for hiding this comment

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

LGTM. @jcanizales to confirm.

@jcanizales jcanizales merged commit b23c86b into grpc:master Dec 5, 2016
@lock lock bot locked as resolved and limited conversation to collaborators Jan 25, 2019
@lock lock bot unassigned makdharma Jan 25, 2019
@thelinuxfoundation
Copy link
Copy Markdown

Thank you for your pull request. Before we can look at your contribution, we need to ensure all contributors are covered by a Contributor License Agreement.

After the following items are addressed, please respond with a new comment here, and the automated system will re-verify.

Regards,
CLA GitHub bot

lidizheng pushed a commit to lidizheng/grpc that referenced this pull request Feb 12, 2021
Description:
Adds serialization method to filter state and use from logger if specified.

Risk Level: Low
Testing: CI
Docs Changes: Added
Release Notes: Added
Fixes grpc#8790

Signed-off-by: Lizan Zhou <[email protected]>

Mirrored from https://github.com/envoyproxy/envoy @ cf74f816933d1350d7c588a3b8478dd399ce3d18
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants