diff --git a/dlls/wbemprox/builtin.c b/dlls/wbemprox/builtin.c index f055547a6b9..4edda854b58 100644 --- a/dlls/wbemprox/builtin.c +++ b/dlls/wbemprox/builtin.c @@ -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: