From 198557261b27a34a3887de95737298ee30aa3cf8 Mon Sep 17 00:00:00 2001 From: Ivan Leo Puoti Date: Wed, 2 Nov 2005 11:42:31 +0000 Subject: [PATCH] Minor fixes to rtl string functions. --- dlls/ntdll/rtlstr.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/dlls/ntdll/rtlstr.c b/dlls/ntdll/rtlstr.c index 2aebbd191eb..6b281cb33df 100644 --- a/dlls/ntdll/rtlstr.c +++ b/dlls/ntdll/rtlstr.c @@ -28,6 +28,7 @@ #include #include "windef.h" +#include "winnt.h" #include "winternl.h" #include "wine/unicode.h" #include "wine/debug.h" @@ -128,7 +129,11 @@ void WINAPI RtlInitString( */ void WINAPI RtlFreeAnsiString( PSTRING str ) { - if (str->Buffer) RtlFreeHeap( GetProcessHeap(), 0, str->Buffer ); + if (str->Buffer) + { + RtlFreeHeap( GetProcessHeap(), 0, str->Buffer ); + RtlZeroMemory( str, sizeof(*str) ); + } } @@ -267,7 +272,11 @@ BOOLEAN WINAPI RtlCreateUnicodeStringFromAsciiz( PUNICODE_STRING target, LPCSTR */ void WINAPI RtlFreeUnicodeString( PUNICODE_STRING str ) { - if (str->Buffer) RtlFreeHeap( GetProcessHeap(), 0, str->Buffer ); + if (str->Buffer) + { + RtlFreeHeap( GetProcessHeap(), 0, str->Buffer ); + RtlZeroMemory( str, sizeof(*str) ); + } }