* regtool.cc (find_key): Fix allocation size of "value".

This commit is contained in:
Corinna Vinschen 2010-03-24 19:52:00 +00:00
parent 4951591733
commit 708d2a1e64
2 changed files with 6 additions and 2 deletions

View File

@ -1,3 +1,7 @@
2010-03-24 Corinna Vinschen <corinna@vinschen.de>
* regtool.cc (find_key): Fix allocation size of "value".
2010-03-23 Corinna Vinschen <corinna@vinschen.de>
* locale.cc (add_locale_alias_locales): Always use loc_num at function

View File

@ -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);
}
}