Author: hbelusca
Date: Wed Jul 13 17:35:16 2016
New Revision: 71929
URL: http://svn.reactos.org/svn/reactos?rev=71929&view=rev
Log:
[NET]
No need to check for whether 'pBuffer' is NULL to call NetApiBufferFree, because:
- 'pBuffer' was used above this call without any particular checks;
- 'pBuffer' can be only null when NetUserEnum fails with an error different from NERR_Success or ERROR_MORE_DATA. But this case was actually checked for before using 'pBuffer'.
By Victor Martinez aka. Mr.Coverity ^^ :)
CID 1363629
CORE-11598 #resolve
Modified:
trunk/reactos/base/applications/network/net/cmdUser.c
Modified: trunk/reactos/base/applications/network/net/cmdUser.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/network/…
==============================================================================
--- trunk/reactos/base/applications/network/net/cmdUser.c [iso-8859-1] (original)
+++ trunk/reactos/base/applications/network/net/cmdUser.c [iso-8859-1] Wed Jul 13 17:35:16 2016
@@ -70,11 +70,8 @@
PrintToConsole(L"%s\n", pBuffer[i].usri0_name);
}
- if (pBuffer != NULL)
- {
- NetApiBufferFree(pBuffer);
- pBuffer = NULL;
- }
+ NetApiBufferFree(pBuffer);
+ pBuffer = NULL;
}
while (Status == ERROR_MORE_DATA);
Author: hbelusca
Date: Wed Jul 13 16:43:16 2016
New Revision: 71928
URL: http://svn.reactos.org/svn/reactos?rev=71928&view=rev
Log:
[NTOSKRNL_VISTA lib]
Initialize utf8_ch_len to zero before using it (at each turn of the for-loop). As I couldn't find this code in Wine, I couldn't see whether they already fixed it or not. Caught by Victor.
CORE-11596
Modified:
trunk/reactos/sdk/lib/drivers/ntoskrnl_vista/rtl.c
Modified: trunk/reactos/sdk/lib/drivers/ntoskrnl_vista/rtl.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/sdk/lib/drivers/ntoskrnl_v…
==============================================================================
--- trunk/reactos/sdk/lib/drivers/ntoskrnl_vista/rtl.c [iso-8859-1] (original)
+++ trunk/reactos/sdk/lib/drivers/ntoskrnl_vista/rtl.c [iso-8859-1] Wed Jul 13 16:43:16 2016
@@ -72,6 +72,9 @@
/* encode ch as UTF-8 */
#ifndef __REACTOS__
assert(ch <= 0x10ffff);
+#endif
+#ifdef __REACTOS__
+ utf8_ch_len = 0; // FIXME: Check whether a non-zero value might be better for the case ch >= 0x200000 ?
#endif
if (ch < 0x80)
{
Author: hbelusca
Date: Wed Jul 13 16:33:37 2016
New Revision: 71927
URL: http://svn.reactos.org/svn/reactos?rev=71927&view=rev
Log:
[SETUP]
- Fix leaking 'pSetupData' in case of failure. CID 1363604
- Since we know that in the remaining of the code, 'pSetupData' is a valid pointer, we can free it at the very end without rechecking whether it was NULL or not.
CORE-11591 #resolve
Modified:
trunk/reactos/base/setup/reactos/reactos.c
Modified: trunk/reactos/base/setup/reactos/reactos.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/base/setup/reactos/reactos…
==============================================================================
--- trunk/reactos/base/setup/reactos/reactos.c [iso-8859-1] (original)
+++ trunk/reactos/base/setup/reactos/reactos.c [iso-8859-1] Wed Jul 13 16:33:37 2016
@@ -788,7 +788,10 @@
if (!pSetupData->bUnattend)
{
if (!LoadSetupData(pSetupData))
+ {
+ HeapFree(GetProcessHeap(), 0, pSetupData);
return 0;
+ }
/* Create the Start page, until setup is working */
psp.dwSize = sizeof(PROPSHEETPAGE);
@@ -881,8 +884,7 @@
if (pSetupData->hTitleFont)
DeleteObject(pSetupData->hTitleFont);
- if (pSetupData != NULL)
- HeapFree(GetProcessHeap(), 0, pSetupData);
+ HeapFree(GetProcessHeap(), 0, pSetupData);
#if 0
EnableShutdownPrivilege();