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

Memory leak in static analysis #544

Open
Sathavahana1901 opened this issue Oct 10, 2024 · 1 comment
Open

Memory leak in static analysis #544

Sathavahana1901 opened this issue Oct 10, 2024 · 1 comment
Labels

Comments

@Sathavahana1901
Copy link

Memory leak in heap_string

issue:
a resource leak in jsoncons/detail/heap_string.hpp at line 158.
The warning indicates that a memory resource allocated at new_allocator.h:114
was not freed, and the last reference to it was lost at heap_string.hpp:175.

actual behavior :
static code analysis(codesonar) tool reporting memory leak

expected behavior :
static code analysis(codesonar) tool report should be clean with out any bugs

run jsoncons through codesonar static analysis tool

Include a small, self-contained example if possible

What compiler, architecture, and operating system?

  • Compiler: g++
  • Architecture (e.g. x86, x64) x86
  • Operating system: ubuntu

What jsoncons library version?

  • Latest release 0.177.0
@danielaparker
Copy link
Owner

I'm quite sure that codesonar is wrong. The type heap_string is used to hold basic_json string values, and as such is the most used type in the jsoncons library. We perform memory checks for all builds, and detect no leaks. The diagnostic is wrong, there is no lost reference.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants