Marcus Meissner : advapi32: Free wstr in error case to avoid leak (Coverity ).
Module: wine Branch: master Commit: 91a767d75b12d67cabfebeb22b7cf176c8b6e4b0 URL: http://source.winehq.org/git/wine.git/?a=commit;h=91a767d75b12d67cabfebeb22b... Author: Marcus Meissner <marcus(a)jet.franken.de> Date: Wed Oct 3 16:21:35 2012 +0200 advapi32: Free wstr in error case to avoid leak (Coverity). --- dlls/advapi32/security.c | 16 ++++++++++++---- 1 files changed, 12 insertions(+), 4 deletions(-) diff --git a/dlls/advapi32/security.c b/dlls/advapi32/security.c index 8b60dd6..c86ca17 100644 --- a/dlls/advapi32/security.c +++ b/dlls/advapi32/security.c @@ -4861,17 +4861,25 @@ BOOL WINAPI ConvertSecurityDescriptorToStringSecurityDescriptorW(PSECURITY_DESCR wstr = wptr = LocalAlloc(0, (len + 1)*sizeof(WCHAR)); if (RequestedInformation & OWNER_SECURITY_INFORMATION) - if (!DumpOwner(SecurityDescriptor, &wptr, NULL)) + if (!DumpOwner(SecurityDescriptor, &wptr, NULL)) { + LocalFree (wstr); return FALSE; + } if (RequestedInformation & GROUP_SECURITY_INFORMATION) - if (!DumpGroup(SecurityDescriptor, &wptr, NULL)) + if (!DumpGroup(SecurityDescriptor, &wptr, NULL)) { + LocalFree (wstr); return FALSE; + } if (RequestedInformation & DACL_SECURITY_INFORMATION) - if (!DumpDacl(SecurityDescriptor, &wptr, NULL)) + if (!DumpDacl(SecurityDescriptor, &wptr, NULL)) { + LocalFree (wstr); return FALSE; + } if (RequestedInformation & SACL_SECURITY_INFORMATION) - if (!DumpSacl(SecurityDescriptor, &wptr, NULL)) + if (!DumpSacl(SecurityDescriptor, &wptr, NULL)) { + LocalFree (wstr); return FALSE; + } *wptr = 0; TRACE("ret: %s, %d\n", wine_dbgstr_w(wstr), len);
participants (1)
-
Alexandre Julliard