From 1746f5f8a80f78a02f79a9a17f29ebb0a7b179ec Mon Sep 17 00:00:00 2001 From: Michael Vetter Date: Sun, 6 Oct 2019 18:53:16 +0200 Subject: Fix memleak in cmd_join Free `room` string in case we allocated it ourselves. Regards https://github.com/profanity-im/profanity/issues/1019 --- src/command/cmd_funcs.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/command') 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; } -- cgit 1.4.1-2-gfad0