Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix trivial leak in ThreadFilter #131

Merged
merged 1 commit into from
Sep 18, 2024
Merged

Fix trivial leak in ThreadFilter #131

merged 1 commit into from
Sep 18, 2024

Conversation

jbachorik
Copy link
Collaborator

What does this PR do?:
It fixes a trivial leak when the destructor of ThreadFilter class did not release the memory allocated for _bitmaps.

Motivation:
Mostly just a code cleanup - with our current usage the ThreadFilter instance will remain active during the whole lifespan of the profiled application so the memory would not really 'leak'. But it is better to have a correct destructor if the usage of ThreadFilter would change in the future.

Additional Notes:

How to test the change?:

For Datadog employees:

  • [] If this PR touches code that signs or publishes builds or packages, or handles
    credentials of any kind, I've requested a review from @DataDog/security-design-and-guidance.
  • This PR doesn't touch any of that.

Unsure? Have a question? Request a review!

Copy link

🔧 Report generated by pr-comment-scanbuild

Scan-Build Report

User:runner@fv-az1776-414
Working Directory:/home/runner/work/java-profiler/java-profiler/ddprof-lib/src/test/make
Command Line:make -j4 clean all
Clang Version:Ubuntu clang version 14.0.0-1ubuntu1.1
Date:Tue Sep 17 13:20:27 2024

Bug Summary

Bug TypeQuantityDisplay?
All Bugs5
Logic error
Assigned value is garbage or undefined1
Dereference of null pointer3
Unused code
Dead nested assignment1

Reports

Bug Group Bug Type ▾ File Function/Method Line Path Length
Logic errorAssigned value is garbage or undefineddwarf.cppparseInstructions24420
Unused codeDead nested assignmentvmStructs.cppcheckNativeBinding8791
Logic errorDereference of null pointersafeAccess.hload3218
Logic errorDereference of null pointersymbols_linux.hElfParser12932
Logic errorDereference of null pointerflightRecorder.cppflush15048

Copy link

🔧 Report generated by pr-comment-cppcheck

CppCheck Report

Warnings (5)

Style Violations (159)

Copy link
Contributor

@richardstartin richardstartin left a comment

Choose a reason for hiding this comment

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

no functional impact but keeps tsan happy?

@jbachorik jbachorik marked this pull request as ready for review September 18, 2024 11:19
@jbachorik
Copy link
Collaborator Author

This was actually not pointed out by tsan - and we are not running it by default anyway.
I came to this while trying to rule out a sneaky memory leak in profiler before blaming malloc fragmentation again,

@jbachorik jbachorik merged commit bdf77af into main Sep 18, 2024
32 checks passed
@github-actions github-actions bot added this to the 1.14.0 milestone Sep 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants