]> git.proxmox.com Git - mirror_edk2.git/blobdiff - ShellPkg/Library/UefiShellLevel2CommandsLib/Cp.c
ShellPkg: Fix timezone command
[mirror_edk2.git] / ShellPkg / Library / UefiShellLevel2CommandsLib / Cp.c
index efc14085c3a08621a833a3ce49f41d9de6fec88e..a576f834464f118b409886e3539b6ae72f5bb4b6 100644 (file)
@@ -326,7 +326,9 @@ ValidateAndCopyFiles(
     } else {\r
       return SHELL_INVALID_PARAMETER;\r
     }\r
-  }  \r
+  }\r
+  \r
+  ASSERT (CleanFilePathStr != NULL);\r
 \r
   //\r
   // If we are trying to copy multiple files... make sure we got a directory for the target...\r
@@ -487,7 +489,7 @@ ValidateAndCopyFiles(
         StrnCat(DestPath, Node->FileName, PathSize/sizeof(CHAR16) - StrLen(DestPath) -1);\r
       }\r
     }\r
-    FreePool (CleanFilePathStr);\r
+    \r
     //\r
     // Make sure the path exists\r
     //\r
@@ -540,6 +542,7 @@ ValidateAndCopyFiles(
   SHELL_FREE_NON_NULL(DestPath);\r
   SHELL_FREE_NON_NULL(HiiOutput);\r
   SHELL_FREE_NON_NULL(HiiResultOk);\r
+  SHELL_FREE_NON_NULL(CleanFilePathStr);\r
   if (Resp == NULL) {\r
     SHELL_FREE_NON_NULL(Response);\r
   }\r