summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorSebastien Helleu <flashcode@flashtux.org>2014-03-02 17:59:40 +0100
committerSebastien Helleu <flashcode@flashtux.org>2014-03-02 17:59:40 +0100
commitbe9046741f87e2eb6fd229945d05f05b6713bd25 (patch)
treede5f5e0182cb0919c417171121ec0ef9b2b24d78 /src
parent32a4f4e1d531086eb4d94df40b2a1eede799c9f2 (diff)
downloadweechat-be9046741f87e2eb6fd229945d05f05b6713bd25.zip
core: fix memory in execution of commands
This memory leak was introduced by commit aa81067ad070f05a4aaf98383781eba0fbafefd6
Diffstat (limited to 'src')
-rw-r--r--src/core/wee-input.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/core/wee-input.c b/src/core/wee-input.c
index 56d1cdfe5..e8ca08605 100644
--- a/src/core/wee-input.c
+++ b/src/core/wee-input.c
@@ -90,6 +90,11 @@ input_exec_command (struct t_gui_buffer *buffer,
pos = strchr (command, ' ');
command_name = (pos) ?
string_strndup (command, pos - command) : strdup (command);
+ if (!command_name)
+ {
+ free (command);
+ return;
+ }
/* execute command */
switch (hook_command_exec (buffer, any_plugin, plugin, command))
@@ -139,6 +144,7 @@ input_exec_command (struct t_gui_buffer *buffer,
break;
}
free (command);
+ free (command_name);
}
/*