wbemprox: Avoid a use after free (Coverity).

Signed-off-by: Sven Baars <sbaars@codeweavers.com>
Signed-off-by: Hans Leidekker <hans@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Sven Baars 2020-08-02 19:20:23 +02:00 committed by Alexandre Julliard
parent 462edf6e2a
commit ea60927fbd
1 changed files with 2 additions and 2 deletions

View File

@ -2116,9 +2116,9 @@ static WCHAR *get_diskdrive_serialnumber( WCHAR letter )
heap_free( desc );
break;
}
size = desc->Size;
heap_free( desc );
if (GetLastError() == ERROR_MORE_DATA) size = desc->Size;
else break;
if (GetLastError() != ERROR_MORE_DATA) break;
}
done: