Repository navigation
Fix potential memory leak in SceneCombiner for LWS/IRR/MD3 loader - #5721
Conversation
|
Also deletes the sourcelist.
|
ff23d6d to
c89fac6
Compare
|
Why Why do you check for |
Thanks for the feedback, I fixed it. |
kimkulling
left a comment
There was a problem hiding this comment.
Looks not bad. Hard to find I guess.
|
Merged, thanks a lot for your contribution. |
) * fix potential memory leak in scenecombiner * also cleansup srclist * de-duplicates before deleting --------- Co-authored-by: Kim Kulling <[email protected]>
Maybe fixes #4231
(fuzzer says, it is a NULL read, but when trying the file, I get a memory leak. Also, in the issue, you also tried to fix some memory leak there. Therefore, not really sure, a bit confusing).
Short explanation about the fix:
SceneCombiner::MergeScenesguarantees by the documentation, that themasterparameter is cleaned up afterwards:This should also include, when the destination is null (case 1. the first inserted delete).
For this bug, it should also clean up, if the scene is copied.
CopySceneFlatdoes not clean up the source according to the documentation:Therefore, the cleanup duty should be in
MergeScenes.I also checked other usage of
MergeSceneoutside of LWS loader.It is also used in
tempscenewhich is used for the master parameter is also not cleaned up -> no risk of double free + also potential leak fix link to the linemasteris also not cleaned up, just in error case, which is not possible afterMergeScene-> no risk of double free + also potential leak fix link to the lineFor the later 2 issues, I couldn't find any fuzzer bug issue but clang-analyzer complains there too about a potential leak.