Quellcode durchsuchen

2021-10/06 / Eason Yang
Action:
1 Replace : free(ptr) for upgrade_check() function.

File:
1. main.c
Action 1

Firmware version: D0.55.XX.XXXX.XX

8009 vor 3 Jahren
Ursprung
Commit
c3d1ecb193
1 geänderte Dateien mit 1 neuen und 1 gelöschten Zeilen
  1. 1 1
      EVSE/Projects/AW-CCS/Apps/main.c

+ 1 - 1
EVSE/Projects/AW-CCS/Apps/main.c

@@ -2984,7 +2984,6 @@ int upgrade_check()
 
 					ShmCharger->fwUpgradeInfo.fwType = ((ptr[0x13]<<0) | (ptr[0x12]<<8) | (ptr[0x11]<<16) | (ptr[0x10]<<24));
 					substr(ShmCharger->fwUpgradeInfo.modelName, (char *)ptr, 0, 0x10);
-					free(ptr);
 					DEBUG_INFO("New firmware type: %X\n", ShmCharger->fwUpgradeInfo.fwType);
 					DEBUG_INFO("New firmware model name: %s, %s\n", ShmCharger->fwUpgradeInfo.modelName, ShmSysConfigAndInfo->SysConfig.ModelName);
 
@@ -3093,6 +3092,7 @@ int upgrade_check()
 						sprintf(cmd, "yes|rm %s", ShmCharger->fwUpgradeInfo.location);
 						system(cmd);
 					}
+					free(ptr);
 				}
 				else
 				{