Use talloc for all memory pool (#1263)

This commit is contained in:
Sukchan Lee 2022-01-04 08:29:18 +09:00
parent 49d9ed03c7
commit b988e7edce
768 changed files with 4632 additions and 4901 deletions

View file

@ -13,10 +13,9 @@ OpenAPI_ue_policy_set_patch_t *OpenAPI_ue_policy_set_patch_create(
OpenAPI_list_t *os_ids
)
{
OpenAPI_ue_policy_set_patch_t *ue_policy_set_patch_local_var = OpenAPI_malloc(sizeof(OpenAPI_ue_policy_set_patch_t));
if (!ue_policy_set_patch_local_var) {
return NULL;
}
OpenAPI_ue_policy_set_patch_t *ue_policy_set_patch_local_var = ogs_malloc(sizeof(OpenAPI_ue_policy_set_patch_t));
ogs_assert(ue_policy_set_patch_local_var);
ue_policy_set_patch_local_var->ue_policy_sections = ue_policy_sections;
ue_policy_set_patch_local_var->upsis = upsis;
ue_policy_set_patch_local_var->is_andsp_ind = is_andsp_ind;
@ -35,6 +34,7 @@ void OpenAPI_ue_policy_set_patch_free(OpenAPI_ue_policy_set_patch_t *ue_policy_s
OpenAPI_lnode_t *node;
OpenAPI_list_for_each(ue_policy_set_patch->ue_policy_sections, node) {
OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data;
ogs_free(localKeyValue->key);
OpenAPI_ue_policy_section_free(localKeyValue->value);
ogs_free(localKeyValue);
}
@ -152,9 +152,9 @@ OpenAPI_ue_policy_set_patch_t *OpenAPI_ue_policy_set_patch_parseFromJSON(cJSON *
cJSON *localMapObject = ue_policy_sections_local_map;
if (cJSON_IsObject(ue_policy_sections_local_map)) {
localMapKeyPair = OpenAPI_map_create(
localMapObject->string, OpenAPI_ue_policy_section_parseFromJSON(localMapObject));
ogs_strdup(localMapObject->string), OpenAPI_ue_policy_section_parseFromJSON(localMapObject));
} else if (cJSON_IsNull(ue_policy_sections_local_map)) {
localMapKeyPair = OpenAPI_map_create(localMapObject->string, NULL);
localMapKeyPair = OpenAPI_map_create(ogs_strdup(localMapObject->string), NULL);
} else {
ogs_error("OpenAPI_ue_policy_set_patch_parseFromJSON() failed [ue_policy_sections]");
goto end;
@ -179,7 +179,7 @@ OpenAPI_ue_policy_set_patch_t *OpenAPI_ue_policy_set_patch_parseFromJSON(cJSON *
ogs_error("OpenAPI_ue_policy_set_patch_parseFromJSON() failed [upsis]");
goto end;
}
OpenAPI_list_add(upsisList , ogs_strdup_or_assert(upsis_local->valuestring));
OpenAPI_list_add(upsisList , ogs_strdup(upsis_local->valuestring));
}
}
@ -217,7 +217,7 @@ OpenAPI_ue_policy_set_patch_t *OpenAPI_ue_policy_set_patch_parseFromJSON(cJSON *
ogs_error("OpenAPI_ue_policy_set_patch_parseFromJSON() failed [os_ids]");
goto end;
}
OpenAPI_list_add(os_idsList , ogs_strdup_or_assert(os_ids_local->valuestring));
OpenAPI_list_add(os_idsList , ogs_strdup(os_ids_local->valuestring));
}
}
@ -226,7 +226,7 @@ OpenAPI_ue_policy_set_patch_t *OpenAPI_ue_policy_set_patch_parseFromJSON(cJSON *
upsis ? upsisList : NULL,
andsp_ind ? true : false,
andsp_ind ? andsp_ind->valueint : 0,
pei ? ogs_strdup_or_assert(pei->valuestring) : NULL,
pei ? ogs_strdup(pei->valuestring) : NULL,
os_ids ? os_idsList : NULL
);