path: fix the RtlReAllocateHeap() call
Dimitrie O. Paun
dpaun at rogers.com
Thu Nov 20 14:59:00 CST 2003
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.
More information about the wine-patches
mailing list