Skip to content
This repository was archived by the owner on May 31, 2025. It is now read-only.

adding decompress to free(state) before return#1293

Closed
aswinthomas wants to merge 2 commits intoros:indigo-develfrom
aswinthomas:decompress-free-before-return
Closed

adding decompress to free(state) before return#1293
aswinthomas wants to merge 2 commits intoros:indigo-develfrom
aswinthomas:decompress-free-before-return

Conversation

@aswinthomas
Copy link
Copy Markdown

@aswinthomas aswinthomas commented Jan 2, 2018

Calling roslz4_compressEnd(&stream) and roslz4_decompressEnd(&stream) to avoid a potential memory leak

ret = roslz4_compressStart(&stream, block_size_id);
if (ret != ROSLZ4_OK) { return ret; }
if (ret != ROSLZ4_OK) {
roslz4_decompressEnd(&stream);
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This doesn't look symmetric should it be roslz4_compressEnd?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Ah Yes! Thanks for catching this

@mikepurvis
Copy link
Copy Markdown
Member

LGTM

@dirk-thomas
Copy link
Copy Markdown
Member

Thank you for the patch. I am closing this in favor of #1313 which uses your patch but targets the latest development branch.

@aswinthomas please see the discussion / comments on the new PR.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants