From 5edbeea338291c3462b7d228cfdee03a284051f7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Helleu?= Date: Sun, 9 Feb 2020 06:56:53 +0100 Subject: [PATCH] core: fix unlikely memory leak in completion --- ChangeLog.adoc | 1 + src/gui/gui-completion.c | 2 ++ 2 files changed, 3 insertions(+) diff --git a/ChangeLog.adoc b/ChangeLog.adoc index a638dbd15..ef1aa87fa 100644 --- a/ChangeLog.adoc +++ b/ChangeLog.adoc @@ -28,6 +28,7 @@ New features:: Bug fixes:: + * core: fix memory leak in completion * core: flush stdout/stderr before forking in hook_process function (issue #1441) * core: fix evaluation of condition with nested "if" (issue #1434) * irc: fix crash when receiving a malformed message 324 (channel mode) diff --git a/src/gui/gui-completion.c b/src/gui/gui-completion.c index d84088337..2d9f43d10 100644 --- a/src/gui/gui-completion.c +++ b/src/gui/gui-completion.c @@ -1320,6 +1320,8 @@ gui_completion_search (struct t_gui_completion *completion, int direction, { case GUI_COMPLETION_NULL: /* should never be executed */ + if (old_word_found) + free (old_word_found); return; case GUI_COMPLETION_COMMAND: gui_completion_command (completion);