Author: pschweitzer
Date: Sat Apr 5 09:17:21 2014
New Revision: 62614
URL: http://svn.reactos.org/svn/reactos?rev=62614&view=rev
Log:
[EPSAPI]
Fix double free in PsaCaptureSystemModules()
CID #1106329
Modified:
trunk/reactos/lib/epsapi/enum/drivers.c
Modified: trunk/reactos/lib/epsapi/enum/drivers.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/lib/epsapi/enum/drivers.c?…
==============================================================================
--- trunk/reactos/lib/epsapi/enum/drivers.c [iso-8859-1] (original)
+++ trunk/reactos/lib/epsapi/enum/drivers.c [iso-8859-1] Sat Apr 5 09:17:21 2014
@@ -100,6 +100,7 @@
ignore the buffer's content at this point, there's no point in a realloc,
that could end up copying a large chunk of data we'd discard anyway */
PsaiFree(psmModules);
+ psmModules = NULL;
pTmp = PsaiMalloc(nSize);
if(pTmp == NULL)
@@ -138,7 +139,7 @@
} while(0);
#endif
/* in case of failure, free the buffer */
- if(!NT_SUCCESS(Status))
+ if(!NT_SUCCESS(Status) && psmModules != NULL)
{
PsaiFree(psmModules);
}