Update: Memory leaks in stdup and asprintf#588
Conversation
syaoraang
left a comment
There was a problem hiding this comment.
Seems pretty good changes, but still we need a few changes.
vandelvan
left a comment
There was a problem hiding this comment.
LGTM, thanks for your contribution
|
LGTM!! Just a question, do you have evidence of any tests performed? |
syaoraang
left a comment
There was a problem hiding this comment.
Excellent work. Thanks for addressing my requests!
amissael95
left a comment
There was a problem hiding this comment.
If possible, we need to avoid the usage of "goto" for new changes. Since no loops are involved in this change we can keep as it is this time. Thanks for working on this change.
75a17a7
into
LinearTapeFileSystem:release/v2.4.8.4
Just for future reference, I used goto because C doesn't have a way of properly handling exceptions like other languages, goto statements used for cleanup is one of the few places where it's considered a good practice, as long as it stays local and doesn't jump upwards. |
Summary of changes
This pull request includes following changes or fixes.
Description
Most of strdups and asprintf functions had no checks on the success or failure of the action leading to potential errors, this PR adds just checks and returns errors according to the codebase section.
Type of change
Checklist: