Commit 0a7084f4 authored by Alex Henrie's avatar Alex Henrie Committed by Alexandre Julliard

reg: Use the wcsdup function instead of reimplementing it.

parent f24edd9d
...@@ -377,10 +377,7 @@ static LONG open_key(struct parser *parser, WCHAR *path) ...@@ -377,10 +377,7 @@ static LONG open_key(struct parser *parser, WCHAR *path)
KEY_ALL_ACCESS|parser->sam, NULL, &parser->hkey, NULL); KEY_ALL_ACCESS|parser->sam, NULL, &parser->hkey, NULL);
if (res == ERROR_SUCCESS) if (res == ERROR_SUCCESS)
{ parser->key_name = wcsdup(path);
parser->key_name = malloc((lstrlenW(path) + 1) * sizeof(WCHAR));
lstrcpyW(parser->key_name, path);
}
else else
parser->hkey = NULL; parser->hkey = NULL;
...@@ -636,8 +633,7 @@ static WCHAR *quoted_value_name_state(struct parser *parser, WCHAR *pos) ...@@ -636,8 +633,7 @@ static WCHAR *quoted_value_name_state(struct parser *parser, WCHAR *pos)
goto invalid; goto invalid;
/* copy the value name in case we need to parse multiple lines and the buffer is overwritten */ /* copy the value name in case we need to parse multiple lines and the buffer is overwritten */
parser->value_name = malloc((lstrlenW(val_name) + 1) * sizeof(WCHAR)); parser->value_name = wcsdup(val_name);
lstrcpyW(parser->value_name, val_name);
set_state(parser, DATA_START); set_state(parser, DATA_START);
return p; return p;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment