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:
@@ -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);
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
Reference in New Issue
Block a user