]> git.proxmox.com Git - mirror_edk2.git/commitdiff
MdeModulePkg/SetupBrowser: Should free ConfigResp when it no longer be used
authorDandan Bi <dandan.bi@intel.com>
Wed, 11 May 2016 02:04:19 +0000 (10:04 +0800)
committerStar Zeng <star.zeng@intel.com>
Tue, 17 May 2016 06:30:40 +0000 (14:30 +0800)
When submit form fail, the progress point to the first fail part
in ConfigResp, so should free the ConfigResp after Progrss has
been processed.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Dandan Bi <dandan.bi@intel.com>
Reviewed-by: Eric Dong <eric.dong@intel.com>
MdeModulePkg/Universal/SetupBrowserDxe/Setup.c

index 23094f8145fa371558ed30d477aa93f4f5a36de4..f649e0497927ebd3aca7016362c28ea39c625a0a 100644 (file)
@@ -3228,7 +3228,6 @@ SubmitForForm (
                                       ConfigResp,\r
                                       &Progress\r
                                       );\r
-    FreePool (ConfigResp);\r
 \r
     if (EFI_ERROR (Status)) {\r
       //\r
@@ -3237,9 +3236,11 @@ SubmitForForm (
       SubmitFormFail = TRUE;\r
       GetSyncRestoreConfigRequest (ConfigInfo->Storage, ConfigInfo->ConfigRequest, Progress, &ConfigInfo->RestoreConfigRequest, &ConfigInfo->SyncConfigRequest);\r
       InsertTailList (&gBrowserSaveFailFormSetList, &ConfigInfo->SaveFailLink);\r
+      FreePool (ConfigResp);\r
       continue;\r
     }\r
 \r
+    FreePool (ConfigResp);\r
     //\r
     // 3. Config success, update storage shadow Buffer, only update the data belong to this form.\r
     //\r