msvcrt-A08: _wsystem bugfix

Jaco Greeff jaco at puxedo.org
Tue Nov 5 07:36:31 CST 2002


Fixed an iditoc bug in _wsystem where I didn't do a malloc(...*sizeof(WHAR))

License:
LGPL

Changelog:
* dlls/msvcrt/process.c: Jaco Greeff <jaco at puxedo.org>
- Fixed incorrect memory allocation in _wsystem to reflect the actual size
-------------- next part --------------
diff -aurN msvcrt-B07/dlls/msvcrt/process.c msvcrt-B08/dlls/msvcrt/process.c
--- msvcrt-B07/dlls/msvcrt/process.c	Tue Nov  5 14:33:22 2002
+++ msvcrt-B08/dlls/msvcrt/process.c	Tue Nov  5 15:32:50 2002
@@ -562,7 +562,7 @@
      * this way, it is executed as "comspec /c command"
      */
     nLen = strlenW(wszComspec)+strlenW(wszExec)+strlenW(wszCmd);
-    if (!(wszCmdcopy = (WCHAR *)MSVCRT_malloc(nLen+1)))
+    if (!(wszCmdcopy = (WCHAR *)MSVCRT_malloc((nLen+1)*sizeof(WCHAR))))
     {
         TRACE("Unable to allocate memory for _wsystem call\n");
         return -1;


More information about the wine-patches mailing list