ntdll: Replace malloc() with RtlAllocateHeap()

Andrew Talbot andrew.talbot at talbotville.com
Tue Feb 17 16:10:57 CST 2009


Changelog:
    ntdll: Replace malloc() with RtlAllocateHeap().

diff --git a/dlls/ntdll/server.c b/dlls/ntdll/server.c
index 145540f..0cade3f 100644
--- a/dlls/ntdll/server.c
+++ b/dlls/ntdll/server.c
@@ -743,13 +743,13 @@ static void setup_config_dir(void)
             struct stat st;
             char *tmp_dir;
 
-            if (!(tmp_dir = malloc( p + 1 - config_dir ))) fatal_error( "out of memory\n" );
+            if (!(tmp_dir = RtlAllocateHeap( GetProcessHeap(), 0, p + 1 - config_dir ))) fatal_error( "out of memory\n" );
             memcpy( tmp_dir, config_dir, p - config_dir );
             tmp_dir[p - config_dir] = 0;
             if (!stat( tmp_dir, &st ) && st.st_uid != getuid())
                 fatal_error( "'%s' is not owned by you, refusing to create a configuration directory there\n",
                              tmp_dir );
-            free( tmp_dir );
+            RtlFreeHeap( GetProcessHeap(), 0, tmp_dir );
         }
 
         mkdir( config_dir, 0777 );



More information about the wine-patches mailing list