Skip to content

[LibWebsocketServer] Clang - Fix memory management for URI in eventCallback #252

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

Merged
merged 2 commits into from
Jun 14, 2025

Conversation

thomas-brunel
Copy link
Contributor

Here is the PR, to solve one the error mentioned in my issue #250.

From what I found, dynamic allocation of arrays is not standard in C++, and Clang reports it as an error, preventing compilation.

@c-jimenez c-jimenez added the bug Something isn't working label Jun 12, 2025
@thomas-brunel thomas-brunel force-pushed the fix/VLA_unsupported_C++ branch from 1d1bc44 to da4cc63 Compare June 12, 2025 17:17
…llback

Signed-off-by: Thomas BRUNEL <thomas.brunel2@icloud.com>
@thomas-brunel thomas-brunel force-pushed the fix/VLA_unsupported_C++ branch from da4cc63 to e42a42a Compare June 12, 2025 17:20
@thomas-brunel
Copy link
Contributor Author

@c-jimenez Thank you for the feedback. I've made the changes.

Copy link
Owner

@c-jimenez c-jimenez left a comment

Choose a reason for hiding this comment

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

I missed this on the first review, but since uri is no more an array but is a raw pointer, we cannot use sizeof(uri) to represent its size.

Co-authored-by: c-jimenez <18682655+c-jimenez@users.noreply.github.com>
@c-jimenez c-jimenez merged commit ee849ec into c-jimenez:develop Jun 14, 2025
4 checks passed
@thomas-brunel thomas-brunel deleted the fix/VLA_unsupported_C++ branch June 16, 2025 17:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants