NetworkPkg: Fix a memory leak issue in UDP6 driver

In UDP6Dxe Udp6Groups(), the code return directly without free the
buffer allocated for McastIp when JoinFlag is TRUE. It is a memory
leak issue that needs to be fixed. This patch is to fix this issue.

Cc: Ye Ting <ting.ye@intel.com>
Cc: Jiaxin Wu <jiaxin.wu@intel.com>
Cc: Fu Siyuan <siyuan.fu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Wang Fan <fan.wang@intel.com>
Reviewed-by: Jiaxin Wu <jiaxin.wu@intel.com>
This commit is contained in:
Wang Fan 2018-01-03 17:35:53 +08:00 committed by Fu Siyuan
parent 2c4a45b361
commit 24ed9cfd23
1 changed files with 3 additions and 0 deletions

View File

@ -351,6 +351,9 @@ Udp6Groups (
Instance = UDP6_INSTANCE_DATA_FROM_THIS (This); Instance = UDP6_INSTANCE_DATA_FROM_THIS (This);
if (!Instance->Configured) { if (!Instance->Configured) {
if (McastIp != NULL) {
FreePool (McastIp);
}
return EFI_NOT_STARTED; return EFI_NOT_STARTED;
} }