Daniel Lehman : msvcp90: Copy name in _Getctype (Valgrind).

Alexandre Julliard julliard at wine.codeweavers.com
Mon Jun 29 08:12:10 CDT 2015


Module: wine
Branch: master
Commit: ec6859f7e82f8148e465307358a43062e80a10e7
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=ec6859f7e82f8148e465307358a43062e80a10e7

Author: Daniel Lehman <dlehman at esri.com>
Date:   Mon Jun 22 17:44:44 2015 -0700

msvcp90: Copy name in _Getctype (Valgrind).

---

 dlls/msvcp90/locale.c | 13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)

diff --git a/dlls/msvcp90/locale.c b/dlls/msvcp90/locale.c
index 9b85322..b3275c1 100644
--- a/dlls/msvcp90/locale.c
+++ b/dlls/msvcp90/locale.c
@@ -682,6 +682,10 @@ _Collvec* __thiscall _Locinfo__Getcoll(const _Locinfo *this, _Collvec *ret)
 _Ctypevec* __cdecl _Getctype(_Ctypevec *ret)
 {
     short *table;
+#if _MSVCP_VER >= 110
+    wchar_t *name;
+    MSVCP_size_t size;
+#endif
 
     TRACE("\n");
 
@@ -689,7 +693,14 @@ _Ctypevec* __cdecl _Getctype(_Ctypevec *ret)
 #if _MSVCP_VER < 110
     ret->handle = ___lc_handle_func()[LC_COLLATE];
 #else
-    ret->name = ___lc_locale_name_func()[LC_COLLATE];
+    if((name = ___lc_locale_name_func()[LC_COLLATE])) {
+        size = wcslen(name)+1;
+        ret->name = malloc(size*sizeof(*name));
+        if(!ret->name) throw_exception(EXCEPTION_BAD_ALLOC, NULL);
+        memcpy(ret->name, name, size*sizeof(*name));
+    } else {
+        ret->name = NULL;
+    }
 #endif
     ret->delfl = TRUE;
     table = malloc(sizeof(short[256]));




More information about the wine-cvs mailing list