path: fix the RtlReAllocateHeap() call

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



ChangeLog
    RtlReAllocateHeap() does not allocate memory.

Index: ./dlls/ntdll/path.c
===================================================================
RCS file: /var/cvs/wine/dlls/ntdll/path.c,v
retrieving revision 1.11
diff -u -r1.11 path.c
--- ./dlls/ntdll/path.c	28 Oct 2003 00:07:56 -0000	1.11
+++ ./dlls/ntdll/path.c	20 Nov 2003 20:57:24 -0000
@@ -282,8 +282,10 @@
             for (needed = 0, ptr = paths; *ptr != 0 && *ptr++ != ';'; needed++);
             if (needed + filelen > allocated)
             {
-                name = (WCHAR*)ntdll_get_process_heap(), 0,
-                                                 name, (needed + filelen) * sizeof(WCHAR));
+                if (!name) name = (WCHAR*)RtlAllocateHeap(ntdll_get_process_heap(), 0,
+                                                  (needed + filelen) * sizeof(WCHAR));
+                else name = (WCHAR*)RtlReAllocateHeap(ntdll_get_process_heap(), 0,
+                                            name, (needed + filelen) * sizeof(WCHAR));
                 if (!name) return 0;
                 allocated = needed + filelen;
             }


-- 
Dimi.



[Index of Archives]     [Gimp for Windows]     [Red Hat]     [Samba]     [Yosemite Camping]     [Graphics Cards]     [Wine Home]

  Powered by Linux