properly free unicode string

svn path=/trunk/; revision=9123
This commit is contained in:
Thomas Bluemel 2004-04-13 16:55:54 +00:00
parent 83af90bff4
commit fa3672479b

View file

@ -16,7 +16,7 @@
* along with this program; if not, write to the Free Software * along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/ */
/* $Id: window.c,v 1.212 2004/04/13 16:48:45 weiden Exp $ /* $Id: window.c,v 1.213 2004/04/13 16:55:54 weiden Exp $
* *
* COPYRIGHT: See COPYING in the top level directory * COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel * PROJECT: ReactOS kernel
@ -426,10 +426,7 @@ static LRESULT IntDestroyWindow(PWINDOW_OBJECT Window,
NtGdiDeleteObject(Window->WindowRegion); NtGdiDeleteObject(Window->WindowRegion);
} }
if(Window->WindowName.Buffer) RtlFreeUnicodeString(&Window->WindowName);
{
ExFreePool(Window->WindowName.Buffer);
}
IntReleaseWindowObject(Window); IntReleaseWindowObject(Window);
@ -3752,10 +3749,7 @@ NtUserDefSetText(HWND WindowHandle, PUNICODE_STRING WindowText)
} }
/* FIXME - do this thread-safe! otherwise one could crash here! */ /* FIXME - do this thread-safe! otherwise one could crash here! */
if(WindowObject->WindowName.Buffer) RtlFreeUnicodeString(&WindowObject->WindowName);
{
ExFreePool(WindowObject->WindowName.Buffer);
}
WindowObject->WindowName = SafeText; WindowObject->WindowName = SafeText;