Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'winsup/utils/regtool.cc')
-rw-r--r--winsup/utils/regtool.cc4
1 files changed, 2 insertions, 2 deletions
diff --git a/winsup/utils/regtool.cc b/winsup/utils/regtool.cc
index 487e779db..d8a492c37 100644
--- a/winsup/utils/regtool.cc
+++ b/winsup/utils/regtool.cc
@@ -377,7 +377,7 @@ find_key (int howmanyparts, REGSAM access, int option = 0)
if (value)
free (value);
len = mbstowcs (NULL, n, 0) + 1;
- value = (wchar_t *) malloc (len);
+ value = (wchar_t *) malloc (len * sizeof (wchar_t));
mbstowcs (value, n, len);
return;
}
@@ -387,7 +387,7 @@ find_key (int howmanyparts, REGSAM access, int option = 0)
if (value)
free (value);
len = mbstowcs (NULL, e + 1, 0) + 1;
- value = (wchar_t *) malloc (len);
+ value = (wchar_t *) malloc (len * sizeof (wchar_t));
mbstowcs (value, e + 1, len);
}
}