Author: hpoussin
Date: Sun May 18 04:34:31 2008
New Revision: 33568
URL:
http://svn.reactos.org/svn/reactos?rev=33568&view=rev
Log:
Free memory only we allocated it
Modified:
trunk/reactos/subsystems/win32/csrss/win32csr/dllmain.c
Modified: trunk/reactos/subsystems/win32/csrss/win32csr/dllmain.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/csrss/win…
==============================================================================
--- trunk/reactos/subsystems/win32/csrss/win32csr/dllmain.c [iso-8859-1] (original)
+++ trunk/reactos/subsystems/win32/csrss/win32csr/dllmain.c [iso-8859-1] Sun May 18
04:34:31 2008
@@ -356,6 +356,7 @@
LPSTR NtStatusString;
UNICODE_STRING MessageU;
ANSI_STRING MessageA;
+ USHORT CaptionSize = 0;
if( !MessageResource->Flags ) {
/* we've got an ansi string */
@@ -369,7 +370,6 @@
RtlUnicodeStringToAnsiString(&MessageA, &MessageU, TRUE);
}
- USHORT CaptionSize = 0;
// check whether a caption exists
if( *MessageA.Buffer == '{' ) {
// get size of the caption
@@ -464,7 +464,10 @@
RtlFreeHeap (RtlGetProcessHeap(), 0, NtStatusString);
}
- RtlFreeAnsiString(&MessageA);
+ if( MessageResource->Flags ) {
+ /* we've got a unicode string */
+ RtlFreeAnsiString(&MessageA);
+ }
}
if( ClientFileNameU.Buffer ) {
RtlFreeHeap (RtlGetProcessHeap(), 0, ClientFileNameU.Buffer);