Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Wu Jiaxin <jiaxin...@intel.com>
Signed-off-by: jiaxinwu <jiaxin...@intel.com>
---
 MdeModulePkg/Universal/Network/Dhcp4Dxe/Dhcp4Driver.c | 15 ++++++++++++++-
 1 file changed, 14 insertions(+), 1 deletion(-)

diff --git a/MdeModulePkg/Universal/Network/Dhcp4Dxe/Dhcp4Driver.c 
b/MdeModulePkg/Universal/Network/Dhcp4Dxe/Dhcp4Driver.c
index d1bba30..9253df2 100644
--- a/MdeModulePkg/Universal/Network/Dhcp4Dxe/Dhcp4Driver.c
+++ b/MdeModulePkg/Universal/Network/Dhcp4Dxe/Dhcp4Driver.c
@@ -1,8 +1,8 @@
 /** @file
 
-Copyright (c) 2006 - 2012, Intel Corporation. All rights reserved.<BR>
+Copyright (c) 2006 - 2015, Intel Corporation. All rights reserved.<BR>
 This program and the accompanying materials
 are licensed and made available under the terms and conditions of the BSD 
License
 which accompanies this distribution.  The full text of the license may be 
found at
 http://opensource.org/licenses/bsd-license.php
 
@@ -716,10 +716,23 @@ Dhcp4ServiceBindingDestroyChild (
   }
 
   RemoveEntryList (&Instance->Link);
   DhcpSb->NumChildren--;
 
+  if (Instance->UdpIo != NULL) {
+    UdpIoCleanIo (Instance->UdpIo);
+    gBS->CloseProtocol (
+           Instance->UdpIo->UdpHandle,
+           &gEfiUdp4ProtocolGuid,
+           Instance->Service->Image,
+           Instance->Handle
+           );
+    UdpIoFreeIo (Instance->UdpIo);
+    Instance->UdpIo = NULL;
+    Instance->Token = NULL;
+  }
+
   gBS->RestoreTPL (OldTpl);
 
   FreePool (Instance);
   return EFI_SUCCESS;
 }
-- 
1.9.5.msysgit.1



------------------------------------------------------------------------------
_______________________________________________
edk2-devel mailing list
edk2-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/edk2-devel

Reply via email to