From e0905d780e1d94a24659f76b59562d659066a15d Mon Sep 17 00:00:00 2001 From: Marcus Meissner Date: Sun, 21 Sep 2014 14:23:08 +0200 Subject: [PATCH] wbemprox: Fixed a memory leak in get_sd (Coverity). --- dlls/wbemprox/security.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/dlls/wbemprox/security.c b/dlls/wbemprox/security.c index 0ff6c0bff94..d3057e01f55 100644 --- a/dlls/wbemprox/security.c +++ b/dlls/wbemprox/security.c @@ -120,8 +120,11 @@ static HRESULT get_sd( SECURITY_DESCRIPTOR **sd, DWORD *size ) if (SUCCEEDED(hr)) { - if (!MakeSelfRelativeSD(&absolute_sd, *sd, size)) + if (!MakeSelfRelativeSD(&absolute_sd, *sd, size)) { + HeapFree( GetProcessHeap(), 0, *sd ); + *sd = NULL; hr = E_FAIL; + } } return hr;