fprintf(stderr, "Invalid option value, Device Path can't be NULL");\r
return STATUS_ERROR;\r
}\r
- Str16 = (CHAR16 *)malloc(1024);\r
+ Str16 = (CHAR16 *)malloc((strlen (Str) + 1) * sizeof (CHAR16));\r
if (Str16 == NULL) {\r
fprintf(stderr, "Resource, memory cannot be allocated");\r
return STATUS_ERROR;\r