fix memory leak bug

This commit is contained in:
SimpleCodeer
2024-04-22 19:47:36 +08:00
parent bb72ed1b0e
commit 52cec8b2ca
@@ -954,6 +954,9 @@ void GtManagerService::TransformJsToBcWhenRestart(const char *codePath, const ch
cJSON *oldJsEngineVerObj = cJSON_GetObjectItem(installRecordJson, JSON_SUB_KEY_JSENGINE_VERSION);
if (oldJsEngineVerObj == nullptr) {
cJSON_Delete(jsEngineVerObj);
cJSON_Delete(installRecordJson);
AdapterFree(bundleJsonPath);
return;
}
if (cJSON_IsString(oldJsEngineVerObj) && strcmp(oldJsEngineVerObj->valuestring, jsEngineVer_) == 0) {