/** @file\r
Definition for Device Path Tool.\r
\r
-Copyright (c) 2017, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2017 - 2018, Intel Corporation. All rights reserved.<BR>\r
This program and the accompanying materials\r
are licensed and made available under the terms and conditions of the BSD License\r
which accompanies this distribution. The full text of the license may be found at\r
}\r
Ascii2UnicodeString(Str, Str16);\r
DevicePath = UefiDevicePathLibConvertTextToDevicePath(Str16);\r
+ if (DevicePath == NULL) {\r
+ fprintf(stderr, "Convert fail, Cannot convert text to a device path");\r
+ free(Str16);\r
+ return STATUS_ERROR;\r
+ }\r
while (!((DevicePath->Type == END_DEVICE_PATH_TYPE) && (DevicePath->SubType == END_ENTIRE_DEVICE_PATH_SUBTYPE)) )\r
{\r
PrintMem (DevicePath, DevicePath->Length[0] | DevicePath->Length[1] << 8);\r
}\r
PrintMem (DevicePath, DevicePath->Length[0] | DevicePath->Length[1] << 8);\r
putchar('\n');\r
+ free(Str16);\r
return STATUS_SUCCESS;\r
}\r