[PATCH v1] erofs-utils: misc: Fix potential memory leak in realloc failure path

Sandeep Dhavale dhavale at google.com
Fri Jul 19 13:31:03 AEST 2024


Hi Gao,

> Is it a lint issue?  Although I think currently userspace malloc
> failures is rare, it'd be better to handle them.

Previously I have used scan-build as a static checker. However today,
one of the realloc code blocks, I stumbled upon while going through
code on another performance problem.
Then I just grepped and found another one so I just fixed them in one go.

> I update this as since the variable definition would be better
> at the beginning of a block...

The edit looks better to me, so feel free to update while applying.
As always, thanks for the review.

Thanks,
Sandeep.


More information about the Linux-erofs mailing list