1
0
mirror of https://github.com/weechat/weechat.git synced 2026-06-28 13:56:37 +02:00

core: fix memory in execution of commands

This memory leak was introduced by commit aa81067ad0
This commit is contained in:
Sebastien Helleu
2014-03-02 17:59:40 +01:00
parent 32a4f4e1d5
commit be9046741f
+6
View File
@@ -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);
}
/*