Robert Wilhelm : scrrun: Avoid memory leak in error case.
Module: wine Branch: oldstable Commit: 7398ee371ab1dd9465fcb12eb12dd1963cc0eab7 URL: https://gitlab.winehq.org/wine/wine/-/commit/7398ee371ab1dd9465fcb12eb12dd19... Author: Robert Wilhelm <robert.wilhelm(a)gmx.net> Date: Fri Aug 19 11:02:01 2022 +0200 scrrun: Avoid memory leak in error case. (cherry picked from commit ccc001ee4379d74d6dd04269532e1d824cc85763) Signed-off-by: Michael Stefaniuc <mstefani(a)winehq.org> --- dlls/scrrun/filesystem.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/dlls/scrrun/filesystem.c b/dlls/scrrun/filesystem.c index 28636800131..38a21443ff2 100644 --- a/dlls/scrrun/filesystem.c +++ b/dlls/scrrun/filesystem.c @@ -3328,7 +3328,11 @@ static HRESULT WINAPI filesys_GetTempName(IFileSystem3 *iface, BSTR *result) return E_OUTOFMEMORY; if(!RtlGenRandom(&random, sizeof(random))) + { + SysFreeString(*result); return E_FAIL; + } + swprintf(*result, 13, L"rad%05X.tmp", random & 0xfffff); return S_OK; }
participants (1)
-
Alexandre Julliard