diff options
author | Michael Vetter <jubalh@iodoru.org> | 2019-10-06 18:53:16 +0200 |
---|---|---|
committer | Michael Vetter <jubalh@iodoru.org> | 2019-10-06 18:53:16 +0200 |
commit | 1746f5f8a80f78a02f79a9a17f29ebb0a7b179ec (patch) | |
tree | fea9078439ed7e2fb52790ae0f693db396e22e57 /src/command | |
parent | 3ce27b47ad815107600c17539ae658c4c073c6de (diff) | |
download | profani-tty-1746f5f8a80f78a02f79a9a17f29ebb0a7b179ec.tar.gz |
Fix memleak in cmd_join
Free `room` string in case we allocated it ourselves. Regards https://github.com/profanity-im/profanity/issues/1019
Diffstat (limited to 'src/command')
-rw-r--r-- | src/command/cmd_funcs.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/command/cmd_funcs.c b/src/command/cmd_funcs.c index 9a3d2c93..7b303b95 100644 --- a/src/command/cmd_funcs.c +++ b/src/command/cmd_funcs.c @@ -3656,6 +3656,11 @@ cmd_join(ProfWin *window, const char *const command, gchar **args) jid_destroy(room_arg); account_free(account); + if (account->muc_service) { + // then we allocated the memory ourself (see above) + free(room); + } + return TRUE; } |