Skip to content

Fix memory leaks#2422

Merged
cary-ilm merged 3 commits into
AcademySoftwareFoundation:mainfrom
kdt3rd:fix_memory_leaks
May 17, 2026
Merged

Fix memory leaks#2422
cary-ilm merged 3 commits into
AcademySoftwareFoundation:mainfrom
kdt3rd:fix_memory_leaks

Conversation

@kdt3rd

@kdt3rd kdt3rd commented May 17, 2026

Copy link
Copy Markdown
Contributor

When running with address sanitizer, noticed a small duplication of a line triggering a leak in a test.

But more importantly, refactor multi-part part array handling to avoid getting out of sync which can trigger more memory leaks, and properly free the part structure.

Addresses https://issues.oss-fuzz.com/issues/512314697

kdt3rd added 3 commits May 17, 2026 22:28
Signed-off-by: Kimball Thurston <kdt3rd@gmail.com>
Signed-off-by: Kimball Thurston <kdt3rd@gmail.com>
failing to add a part was not reverting cleanly. However, when
reverting, the array storing the list of the parts was not being updated
correctly, causing more potential memory leaks with lots of failures.

Signed-off-by: Kimball Thurston <kdt3rd@gmail.com>

@cary-ilm cary-ilm left a comment

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.

LGTM, thanks!

@cary-ilm cary-ilm merged commit 227656e into AcademySoftwareFoundation:main May 17, 2026
50 checks passed
cary-ilm pushed a commit that referenced this pull request May 21, 2026
* fix memory leak in test only - invalid api call

Signed-off-by: Kimball Thurston <kdt3rd@gmail.com>

* simplify string init

Signed-off-by: Kimball Thurston <kdt3rd@gmail.com>

* refactor part memory handling for parts

failing to add a part was not reverting cleanly. However, when
reverting, the array storing the list of the parts was not being updated
correctly, causing more potential memory leaks with lots of failures.

Signed-off-by: Kimball Thurston <kdt3rd@gmail.com>

---------

Signed-off-by: Kimball Thurston <kdt3rd@gmail.com>
palemieux pushed a commit to sandflow/openexr-ht that referenced this pull request Jun 10, 2026
* fix memory leak in test only - invalid api call

Signed-off-by: Kimball Thurston <kdt3rd@gmail.com>

* simplify string init

Signed-off-by: Kimball Thurston <kdt3rd@gmail.com>

* refactor part memory handling for parts

failing to add a part was not reverting cleanly. However, when
reverting, the array storing the list of the parts was not being updated
correctly, causing more potential memory leaks with lots of failures.

Signed-off-by: Kimball Thurston <kdt3rd@gmail.com>

---------

Signed-off-by: Kimball Thurston <kdt3rd@gmail.com>
Signed-off-by: Pierre-Anthony Lemieux <pal@sandflow.com>
peterhillman pushed a commit that referenced this pull request Jun 19, 2026
* fix memory leak in test only - invalid api call

Signed-off-by: Kimball Thurston <kdt3rd@gmail.com>

* simplify string init

Signed-off-by: Kimball Thurston <kdt3rd@gmail.com>

* refactor part memory handling for parts

failing to add a part was not reverting cleanly. However, when
reverting, the array storing the list of the parts was not being updated
correctly, causing more potential memory leaks with lots of failures.

Signed-off-by: Kimball Thurston <kdt3rd@gmail.com>

---------

Signed-off-by: Kimball Thurston <kdt3rd@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants