[Bugfix][T106][task-view-57]Solve file handle may not right close

Only Configure: No
Affected branch: master
Affected module: FOTA
Is it affected on both ZXIC and MTK: ZXIC
Self-test: Yes
Doc Update: No

Change-Id: Ide89d4280cb42433646904fd17342aa26a37e125
diff --git a/cap/zx297520v3/sources/meta-zxic-custom/recipes-lynq/lynq-fota-backup/files/lynq-fota-backup.cpp b/cap/zx297520v3/sources/meta-zxic-custom/recipes-lynq/lynq-fota-backup/files/lynq-fota-backup.cpp
index 5fff5eb..c2e7d1d 100755
--- a/cap/zx297520v3/sources/meta-zxic-custom/recipes-lynq/lynq-fota-backup/files/lynq-fota-backup.cpp
+++ b/cap/zx297520v3/sources/meta-zxic-custom/recipes-lynq/lynq-fota-backup/files/lynq-fota-backup.cpp
@@ -144,9 +144,11 @@
                 if(ret < 0 )

                 {

                     LYERRLOG("A/B sync system failed \n");

+                    fclose(fp);

                     return -1;

                 }

                 LYINFLOG("A/B sync system success,record current sys \n");

+                fclose(fp);

                 fp = fopen(FOTA_CURRENT_SYS,"w");

                 if(fp == NULL)

                 {

@@ -158,7 +160,6 @@
                 fclose(fp);

                 system("sync");

                 

-                

                 return 0;

             }

         }

@@ -178,6 +179,7 @@
         if(current_sys < 0)

         {

             LYERRLOG("Get current system failed %d\n",current_sys);

+            fclose(fp);

             return -1;

         }