Reviewed-by: Eric Dong <eric.d...@intel.com>

> -----Original Message-----
> From: Bi, Dandan
> Sent: Wednesday, May 11, 2016 3:17 PM
> To: edk2-devel@lists.01.org
> Cc: Dong, Eric
> Subject: [patch] MdeModulePkg/SetupBrowser: Should free ConfigResp when it no 
> longer be used
> 
> When submit form fail, the progress point to the first fail part
> in ConfigResp, so should free the ConfigResp after Progrss has
> been processed.
> 
> Cc: Eric Dong <eric.d...@intel.com>
> Contributed-under: TianoCore Contribution Agreement 1.0
> Signed-off-by: Dandan Bi <dandan...@intel.com>
> ---
>  MdeModulePkg/Universal/SetupBrowserDxe/Setup.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/MdeModulePkg/Universal/SetupBrowserDxe/Setup.c 
> b/MdeModulePkg/Universal/SetupBrowserDxe/Setup.c
> index 23094f8..f649e04 100644
> --- a/MdeModulePkg/Universal/SetupBrowserDxe/Setup.c
> +++ b/MdeModulePkg/Universal/SetupBrowserDxe/Setup.c
> @@ -3226,22 +3226,23 @@ SubmitForForm (
>      Status = mHiiConfigRouting->RouteConfig (
>                                        mHiiConfigRouting,
>                                        ConfigResp,
>                                        &Progress
>                                        );
> -    FreePool (ConfigResp);
> 
>      if (EFI_ERROR (Status)) {
>        //
>        // Submit fail, to get the RestoreConfigRequest and SyncConfigRequest.
>        //
>        SubmitFormFail = TRUE;
>        GetSyncRestoreConfigRequest (ConfigInfo->Storage, 
> ConfigInfo->ConfigRequest, Progress, &ConfigInfo->RestoreConfigRequest,
> &ConfigInfo->SyncConfigRequest);
>        InsertTailList (&gBrowserSaveFailFormSetList, 
> &ConfigInfo->SaveFailLink);
> +      FreePool (ConfigResp);
>        continue;
>      }
> 
> +    FreePool (ConfigResp);
>      //
>      // 3. Config success, update storage shadow Buffer, only update the data 
> belong to this form.
>      //
>      SynchronizeStorage (ConfigInfo->Storage, ConfigInfo->ConfigRequest, 
> TRUE);
>    }
> --
> 1.9.5.msysgit.1

_______________________________________________
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel

Reply via email to