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:
Robert Shearman 2006-04-07 11:17:12 +01:00 committed by Alexandre Julliard
parent 0bf1c22cad
commit 7a3df4d097
1 changed files with 3 additions and 4 deletions

View File

@ -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;
}