server: Free ptr in console_input_append_hist.
Free ptr in console_input_append_hist before returning, otherwise it will be leaked (found by Coverity). Remove the setting of last error on mem_alloc failure, as it is already done in mem_alloc.
This commit is contained in:
parent
0bf1c22cad
commit
7a3df4d097
|
@ -897,13 +897,12 @@ static void console_input_append_hist( struct console_input* console, const WCHA
|
|||
WCHAR* ptr = mem_alloc( (len + 1) * sizeof(WCHAR) );
|
||||
|
||||
if (!ptr)
|
||||
{
|
||||
set_error( STATUS_NO_MEMORY );
|
||||
return;
|
||||
}
|
||||
return;
|
||||
|
||||
if (!console || !console->history_size)
|
||||
{
|
||||
set_error( STATUS_INVALID_PARAMETER ); /* FIXME */
|
||||
free( ptr );
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue