Author: tkreuzer
Date: Fri Sep 28 08:17:13 2007
New Revision: 29267
URL:
http://svn.reactos.org/svn/reactos?rev=29267&view=rev
Log:
free memory before returning on failure.
Thanks to Yaron Aharonson (yaron.aharonson(a)gmail.com) for spotting this.
See issue #2694 for more details.
Modified:
trunk/reactos/lib/cmlib/hivewrt.c
Modified: trunk/reactos/lib/cmlib/hivewrt.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/cmlib/hivewrt.c?rev=29…
==============================================================================
--- trunk/reactos/lib/cmlib/hivewrt.c (original)
+++ trunk/reactos/lib/cmlib/hivewrt.c Fri Sep 28 08:17:13 2007
@@ -62,12 +62,12 @@
/* Write hive block and block bitmap */
Success = RegistryHive->FileWrite(RegistryHive, HV_TYPE_LOG,
0, Buffer, BufferSize);
- if (!Success)
- {
- return FALSE;
- }
-
RegistryHive->Free(Buffer);
+
+ if (!Success)
+ {
+ return FALSE;
+ }
/* Write dirty blocks */
FileOffset = BufferSize;