mirror of
https://github.com/open5gs/open5gs.git
synced 2026-05-02 21:30:10 +00:00
Use talloc for all memory pool (#1263)
This commit is contained in:
parent
49d9ed03c7
commit
b988e7edce
768 changed files with 4632 additions and 4901 deletions
|
|
@ -16,10 +16,9 @@ OpenAPI_policy_update_t *OpenAPI_policy_update_create(
|
|||
OpenAPI_list_t* pras
|
||||
)
|
||||
{
|
||||
OpenAPI_policy_update_t *policy_update_local_var = OpenAPI_malloc(sizeof(OpenAPI_policy_update_t));
|
||||
if (!policy_update_local_var) {
|
||||
return NULL;
|
||||
}
|
||||
OpenAPI_policy_update_t *policy_update_local_var = ogs_malloc(sizeof(OpenAPI_policy_update_t));
|
||||
ogs_assert(policy_update_local_var);
|
||||
|
||||
policy_update_local_var->resource_uri = resource_uri;
|
||||
policy_update_local_var->triggers = triggers;
|
||||
policy_update_local_var->serv_area_res = serv_area_res;
|
||||
|
|
@ -47,6 +46,7 @@ void OpenAPI_policy_update_free(OpenAPI_policy_update_t *policy_update)
|
|||
OpenAPI_ambr_free(policy_update->ue_ambr);
|
||||
OpenAPI_list_for_each(policy_update->pras, node) {
|
||||
OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data;
|
||||
ogs_free(localKeyValue->key);
|
||||
OpenAPI_presence_info_rm_free(localKeyValue->value);
|
||||
ogs_free(localKeyValue);
|
||||
}
|
||||
|
|
@ -258,9 +258,9 @@ OpenAPI_policy_update_t *OpenAPI_policy_update_parseFromJSON(cJSON *policy_updat
|
|||
cJSON *localMapObject = pras_local_map;
|
||||
if (cJSON_IsObject(pras_local_map)) {
|
||||
localMapKeyPair = OpenAPI_map_create(
|
||||
localMapObject->string, OpenAPI_presence_info_rm_parseFromJSON(localMapObject));
|
||||
ogs_strdup(localMapObject->string), OpenAPI_presence_info_rm_parseFromJSON(localMapObject));
|
||||
} else if (cJSON_IsNull(pras_local_map)) {
|
||||
localMapKeyPair = OpenAPI_map_create(localMapObject->string, NULL);
|
||||
localMapKeyPair = OpenAPI_map_create(ogs_strdup(localMapObject->string), NULL);
|
||||
} else {
|
||||
ogs_error("OpenAPI_policy_update_parseFromJSON() failed [pras]");
|
||||
goto end;
|
||||
|
|
@ -270,7 +270,7 @@ OpenAPI_policy_update_t *OpenAPI_policy_update_parseFromJSON(cJSON *policy_updat
|
|||
}
|
||||
|
||||
policy_update_local_var = OpenAPI_policy_update_create (
|
||||
ogs_strdup_or_assert(resource_uri->valuestring),
|
||||
ogs_strdup(resource_uri->valuestring),
|
||||
triggers ? triggersList : NULL,
|
||||
serv_area_res ? serv_area_res_local_nonprim : NULL,
|
||||
wl_serv_area_res ? wl_serv_area_res_local_nonprim : NULL,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue