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

m_RawData get delete[]d in copy-operator even if m_DeleteRawDataAtDestructor is not set #1626

Open
Elgu opened this issue Oct 30, 2024 · 1 comment
Labels

Comments

@Elgu
Copy link

Elgu commented Oct 30, 2024

if (m_RawData != nullptr)

If you have a RawPacket referencing some memory buffer and then assign another RawPacket to that instance,
delete[] will be called on m_RawData whether m_DeleteRawDataAtDestructor is set or not.

See the implmentation of the destructor, maybe there should be a common clear() method.

@seladb
Copy link
Owner

seladb commented Nov 4, 2024

Thanks for flagging @Elgu , I think this is indeed a bug. Would you consider opening a PR with a fix?

@seladb seladb added the bug label Nov 4, 2024
@Dimi1010 Dimi1010 linked a pull request Dec 24, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants