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

return value of prof_get_current_nick cannot be freed #2013

Open
ventosus opened this issue Jan 18, 2025 · 0 comments · May be fixed by #2014
Open

return value of prof_get_current_nick cannot be freed #2013

ventosus opened this issue Jan 18, 2025 · 0 comments · May be fixed by #2014

Comments

@ventosus
Copy link

Either the function definition in profapi.h is wrong, i.e. schould be a const char* ...

char* (*prof_get_current_nick)(void);

... or a strdup is missing somewhere, because a free of the returned value crashes profanity.

ventosus added a commit to ventosus/profanity that referenced this issue Jan 19, 2025
In the documentation of the `muc_nick` function we can read:

> The nickname is owned by the chat room and should not be modified or freed

We should reflect that in the return type and `strdup` the value for the
plugin API.

Fixes: profanity-im#2013
@ventosus ventosus linked a pull request Jan 19, 2025 that will close this issue
ventosus added a commit to ventosus/profanity that referenced this issue Jan 19, 2025
In the documentation of the `muc_nick` function we can read:

> The nickname is owned by the chat room and should not be modified or freed

We should reflect that in the return type and `strdup` the value for the
plugin API.

Fixes: profanity-im#2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants