]> git.proxmox.com Git - mirror_edk2.git/commitdiff
Make sure gBS FreePool() is used to free the buffer always allocated by gBS AllocateP...
authorlgao4 <lgao4@6f19259b-4bc3-4df7-8a09-765794883524>
Mon, 26 Jul 2010 16:20:56 +0000 (16:20 +0000)
committerlgao4 <lgao4@6f19259b-4bc3-4df7-8a09-765794883524>
Mon, 26 Jul 2010 16:20:56 +0000 (16:20 +0000)
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@10696 6f19259b-4bc3-4df7-8a09-765794883524

MdeModulePkg/Library/DxeNetLib/DxeNetLib.c

index c055db2b7741514ffbdae87afebb70a389bada71..4bd84c4de7342f0a5db8129e67b69fd704dcb701 100644 (file)
@@ -185,7 +185,11 @@ SyslogLocateSnp (
     Snp = NULL;\r
   }\r
 \r
-  FreePool (Handles);\r
+  //\r
+  // Handles is allocated by gBS AllocatePool() service. \r
+  // So, gBS FreePool() service is used to free Handles.\r
+  //\r
+  gBS->FreePool (Handles);\r
   return Snp;\r
 }\r
 \r
@@ -1638,7 +1642,11 @@ NetGetChildHandle (
               // Found item matched gEfiNicIp4ConfigVariableGuid\r
               //\r
               *ChildHandle = Handles[Index];\r
-              FreePool (Handles);\r
+              //\r
+              // Handles is allocated by gBS AllocatePool() service. \r
+              // So, gBS FreePool() service is used to free Handles.\r
+              //\r
+              gBS->FreePool (Handles);\r
               return EFI_SUCCESS;\r
             }\r
           }\r
@@ -1647,7 +1655,11 @@ NetGetChildHandle (
     }\r
   }\r
 \r
-  FreePool (Handles);\r
+  //\r
+  // Handles is allocated by gBS AllocatePool() service. \r
+  // So, gBS FreePool() service is used to free Handles.\r
+  //\r
+  gBS->FreePool (Handles);\r
   return Status;\r
 }\r
 \r