diff --git a/kubernetes/model/core_v1_event_list.c b/kubernetes/model/core_v1_event_list.c index 1959a171..8284ea74 100644 --- a/kubernetes/model/core_v1_event_list.c +++ b/kubernetes/model/core_v1_event_list.c @@ -116,6 +116,9 @@ core_v1_event_list_t *core_v1_event_list_parseFromJSON(cJSON *core_v1_event_list core_v1_event_list_t *core_v1_event_list_local_var = NULL; + // define the local list for core_v1_event_list->items + list_t *itemsList = NULL; + // define the local variable for core_v1_event_list->metadata v1_list_meta_t *metadata_local_nonprim = NULL; @@ -134,9 +137,8 @@ core_v1_event_list_t *core_v1_event_list_parseFromJSON(cJSON *core_v1_event_list goto end; } - list_t *itemsList; - cJSON *items_local_nonprimitive; + cJSON *items_local_nonprimitive = NULL; if(!cJSON_IsArray(items)){ goto end; //nonprimitive container } @@ -178,6 +180,15 @@ core_v1_event_list_t *core_v1_event_list_parseFromJSON(cJSON *core_v1_event_list return core_v1_event_list_local_var; end: + if (itemsList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, itemsList) { + core_v1_event_free(listEntry->data); + listEntry->data = NULL; + } + list_freeList(itemsList); + itemsList = NULL; + } if (metadata_local_nonprim) { v1_list_meta_free(metadata_local_nonprim); metadata_local_nonprim = NULL; diff --git a/kubernetes/model/events_v1_event_list.c b/kubernetes/model/events_v1_event_list.c index a1c50362..bf776d7f 100644 --- a/kubernetes/model/events_v1_event_list.c +++ b/kubernetes/model/events_v1_event_list.c @@ -116,6 +116,9 @@ events_v1_event_list_t *events_v1_event_list_parseFromJSON(cJSON *events_v1_even events_v1_event_list_t *events_v1_event_list_local_var = NULL; + // define the local list for events_v1_event_list->items + list_t *itemsList = NULL; + // define the local variable for events_v1_event_list->metadata v1_list_meta_t *metadata_local_nonprim = NULL; @@ -134,9 +137,8 @@ events_v1_event_list_t *events_v1_event_list_parseFromJSON(cJSON *events_v1_even goto end; } - list_t *itemsList; - cJSON *items_local_nonprimitive; + cJSON *items_local_nonprimitive = NULL; if(!cJSON_IsArray(items)){ goto end; //nonprimitive container } @@ -178,6 +180,15 @@ events_v1_event_list_t *events_v1_event_list_parseFromJSON(cJSON *events_v1_even return events_v1_event_list_local_var; end: + if (itemsList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, itemsList) { + events_v1_event_free(listEntry->data); + listEntry->data = NULL; + } + list_freeList(itemsList); + itemsList = NULL; + } if (metadata_local_nonprim) { v1_list_meta_free(metadata_local_nonprim); metadata_local_nonprim = NULL; diff --git a/kubernetes/model/v1_aggregation_rule.c b/kubernetes/model/v1_aggregation_rule.c index 4ebd82d3..ff01be2f 100644 --- a/kubernetes/model/v1_aggregation_rule.c +++ b/kubernetes/model/v1_aggregation_rule.c @@ -67,11 +67,13 @@ v1_aggregation_rule_t *v1_aggregation_rule_parseFromJSON(cJSON *v1_aggregation_r v1_aggregation_rule_t *v1_aggregation_rule_local_var = NULL; + // define the local list for v1_aggregation_rule->cluster_role_selectors + list_t *cluster_role_selectorsList = NULL; + // v1_aggregation_rule->cluster_role_selectors cJSON *cluster_role_selectors = cJSON_GetObjectItemCaseSensitive(v1_aggregation_ruleJSON, "clusterRoleSelectors"); - list_t *cluster_role_selectorsList; if (cluster_role_selectors) { - cJSON *cluster_role_selectors_local_nonprimitive; + cJSON *cluster_role_selectors_local_nonprimitive = NULL; if(!cJSON_IsArray(cluster_role_selectors)){ goto end; //nonprimitive container } @@ -96,6 +98,15 @@ v1_aggregation_rule_t *v1_aggregation_rule_parseFromJSON(cJSON *v1_aggregation_r return v1_aggregation_rule_local_var; end: + if (cluster_role_selectorsList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, cluster_role_selectorsList) { + v1_label_selector_free(listEntry->data); + listEntry->data = NULL; + } + list_freeList(cluster_role_selectorsList); + cluster_role_selectorsList = NULL; + } return NULL; } diff --git a/kubernetes/model/v1_api_group.c b/kubernetes/model/v1_api_group.c index 584a4910..c26c0819 100644 --- a/kubernetes/model/v1_api_group.c +++ b/kubernetes/model/v1_api_group.c @@ -164,6 +164,12 @@ v1_api_group_t *v1_api_group_parseFromJSON(cJSON *v1_api_groupJSON){ // define the local variable for v1_api_group->preferred_version v1_group_version_for_discovery_t *preferred_version_local_nonprim = NULL; + // define the local list for v1_api_group->server_address_by_client_cidrs + list_t *server_address_by_client_cidrsList = NULL; + + // define the local list for v1_api_group->versions + list_t *versionsList = NULL; + // v1_api_group->api_version cJSON *api_version = cJSON_GetObjectItemCaseSensitive(v1_api_groupJSON, "apiVersion"); if (api_version) { @@ -202,9 +208,8 @@ v1_api_group_t *v1_api_group_parseFromJSON(cJSON *v1_api_groupJSON){ // v1_api_group->server_address_by_client_cidrs cJSON *server_address_by_client_cidrs = cJSON_GetObjectItemCaseSensitive(v1_api_groupJSON, "serverAddressByClientCIDRs"); - list_t *server_address_by_client_cidrsList; if (server_address_by_client_cidrs) { - cJSON *server_address_by_client_cidrs_local_nonprimitive; + cJSON *server_address_by_client_cidrs_local_nonprimitive = NULL; if(!cJSON_IsArray(server_address_by_client_cidrs)){ goto end; //nonprimitive container } @@ -228,9 +233,8 @@ v1_api_group_t *v1_api_group_parseFromJSON(cJSON *v1_api_groupJSON){ goto end; } - list_t *versionsList; - cJSON *versions_local_nonprimitive; + cJSON *versions_local_nonprimitive = NULL; if(!cJSON_IsArray(versions)){ goto end; //nonprimitive container } @@ -263,6 +267,24 @@ v1_api_group_t *v1_api_group_parseFromJSON(cJSON *v1_api_groupJSON){ v1_group_version_for_discovery_free(preferred_version_local_nonprim); preferred_version_local_nonprim = NULL; } + if (server_address_by_client_cidrsList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, server_address_by_client_cidrsList) { + v1_server_address_by_client_cidr_free(listEntry->data); + listEntry->data = NULL; + } + list_freeList(server_address_by_client_cidrsList); + server_address_by_client_cidrsList = NULL; + } + if (versionsList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, versionsList) { + v1_group_version_for_discovery_free(listEntry->data); + listEntry->data = NULL; + } + list_freeList(versionsList); + versionsList = NULL; + } return NULL; } diff --git a/kubernetes/model/v1_api_group_list.c b/kubernetes/model/v1_api_group_list.c index 9a830ad3..a35cef05 100644 --- a/kubernetes/model/v1_api_group_list.c +++ b/kubernetes/model/v1_api_group_list.c @@ -97,6 +97,9 @@ v1_api_group_list_t *v1_api_group_list_parseFromJSON(cJSON *v1_api_group_listJSO v1_api_group_list_t *v1_api_group_list_local_var = NULL; + // define the local list for v1_api_group_list->groups + list_t *groupsList = NULL; + // v1_api_group_list->api_version cJSON *api_version = cJSON_GetObjectItemCaseSensitive(v1_api_group_listJSON, "apiVersion"); if (api_version) { @@ -112,9 +115,8 @@ v1_api_group_list_t *v1_api_group_list_parseFromJSON(cJSON *v1_api_group_listJSO goto end; } - list_t *groupsList; - cJSON *groups_local_nonprimitive; + cJSON *groups_local_nonprimitive = NULL; if(!cJSON_IsArray(groups)){ goto end; //nonprimitive container } @@ -149,6 +151,15 @@ v1_api_group_list_t *v1_api_group_list_parseFromJSON(cJSON *v1_api_group_listJSO return v1_api_group_list_local_var; end: + if (groupsList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, groupsList) { + v1_api_group_free(listEntry->data); + listEntry->data = NULL; + } + list_freeList(groupsList); + groupsList = NULL; + } return NULL; } diff --git a/kubernetes/model/v1_api_resource.c b/kubernetes/model/v1_api_resource.c index e1944c27..2350e51c 100644 --- a/kubernetes/model/v1_api_resource.c +++ b/kubernetes/model/v1_api_resource.c @@ -220,11 +220,19 @@ v1_api_resource_t *v1_api_resource_parseFromJSON(cJSON *v1_api_resourceJSON){ v1_api_resource_t *v1_api_resource_local_var = NULL; + // define the local list for v1_api_resource->categories + list_t *categoriesList = NULL; + + // define the local list for v1_api_resource->short_names + list_t *short_namesList = NULL; + + // define the local list for v1_api_resource->verbs + list_t *verbsList = NULL; + // v1_api_resource->categories cJSON *categories = cJSON_GetObjectItemCaseSensitive(v1_api_resourceJSON, "categories"); - list_t *categoriesList; if (categories) { - cJSON *categories_local; + cJSON *categories_local = NULL; if(!cJSON_IsArray(categories)) { goto end;//primitive container } @@ -287,9 +295,8 @@ v1_api_resource_t *v1_api_resource_parseFromJSON(cJSON *v1_api_resourceJSON){ // v1_api_resource->short_names cJSON *short_names = cJSON_GetObjectItemCaseSensitive(v1_api_resourceJSON, "shortNames"); - list_t *short_namesList; if (short_names) { - cJSON *short_names_local; + cJSON *short_names_local = NULL; if(!cJSON_IsArray(short_names)) { goto end;//primitive container } @@ -332,9 +339,8 @@ v1_api_resource_t *v1_api_resource_parseFromJSON(cJSON *v1_api_resourceJSON){ goto end; } - list_t *verbsList; - cJSON *verbs_local; + cJSON *verbs_local = NULL; if(!cJSON_IsArray(verbs)) { goto end;//primitive container } @@ -374,6 +380,33 @@ v1_api_resource_t *v1_api_resource_parseFromJSON(cJSON *v1_api_resourceJSON){ return v1_api_resource_local_var; end: + if (categoriesList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, categoriesList) { + free(listEntry->data); + listEntry->data = NULL; + } + list_freeList(categoriesList); + categoriesList = NULL; + } + if (short_namesList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, short_namesList) { + free(listEntry->data); + listEntry->data = NULL; + } + list_freeList(short_namesList); + short_namesList = NULL; + } + if (verbsList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, verbsList) { + free(listEntry->data); + listEntry->data = NULL; + } + list_freeList(verbsList); + verbsList = NULL; + } return NULL; } diff --git a/kubernetes/model/v1_api_resource_list.c b/kubernetes/model/v1_api_resource_list.c index 8fc191dc..061973cd 100644 --- a/kubernetes/model/v1_api_resource_list.c +++ b/kubernetes/model/v1_api_resource_list.c @@ -113,6 +113,9 @@ v1_api_resource_list_t *v1_api_resource_list_parseFromJSON(cJSON *v1_api_resourc v1_api_resource_list_t *v1_api_resource_list_local_var = NULL; + // define the local list for v1_api_resource_list->resources + list_t *resourcesList = NULL; + // v1_api_resource_list->api_version cJSON *api_version = cJSON_GetObjectItemCaseSensitive(v1_api_resource_listJSON, "apiVersion"); if (api_version) { @@ -149,9 +152,8 @@ v1_api_resource_list_t *v1_api_resource_list_parseFromJSON(cJSON *v1_api_resourc goto end; } - list_t *resourcesList; - cJSON *resources_local_nonprimitive; + cJSON *resources_local_nonprimitive = NULL; if(!cJSON_IsArray(resources)){ goto end; //nonprimitive container } @@ -178,6 +180,15 @@ v1_api_resource_list_t *v1_api_resource_list_parseFromJSON(cJSON *v1_api_resourc return v1_api_resource_list_local_var; end: + if (resourcesList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, resourcesList) { + v1_api_resource_free(listEntry->data); + listEntry->data = NULL; + } + list_freeList(resourcesList); + resourcesList = NULL; + } return NULL; } diff --git a/kubernetes/model/v1_api_service_list.c b/kubernetes/model/v1_api_service_list.c index 4c167b83..b6c7df42 100644 --- a/kubernetes/model/v1_api_service_list.c +++ b/kubernetes/model/v1_api_service_list.c @@ -116,6 +116,9 @@ v1_api_service_list_t *v1_api_service_list_parseFromJSON(cJSON *v1_api_service_l v1_api_service_list_t *v1_api_service_list_local_var = NULL; + // define the local list for v1_api_service_list->items + list_t *itemsList = NULL; + // define the local variable for v1_api_service_list->metadata v1_list_meta_t *metadata_local_nonprim = NULL; @@ -134,9 +137,8 @@ v1_api_service_list_t *v1_api_service_list_parseFromJSON(cJSON *v1_api_service_l goto end; } - list_t *itemsList; - cJSON *items_local_nonprimitive; + cJSON *items_local_nonprimitive = NULL; if(!cJSON_IsArray(items)){ goto end; //nonprimitive container } @@ -178,6 +180,15 @@ v1_api_service_list_t *v1_api_service_list_parseFromJSON(cJSON *v1_api_service_l return v1_api_service_list_local_var; end: + if (itemsList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, itemsList) { + v1_api_service_free(listEntry->data); + listEntry->data = NULL; + } + list_freeList(itemsList); + itemsList = NULL; + } if (metadata_local_nonprim) { v1_list_meta_free(metadata_local_nonprim); metadata_local_nonprim = NULL; diff --git a/kubernetes/model/v1_api_service_status.c b/kubernetes/model/v1_api_service_status.c index 01c89b26..d8f80e9d 100644 --- a/kubernetes/model/v1_api_service_status.c +++ b/kubernetes/model/v1_api_service_status.c @@ -67,11 +67,13 @@ v1_api_service_status_t *v1_api_service_status_parseFromJSON(cJSON *v1_api_servi v1_api_service_status_t *v1_api_service_status_local_var = NULL; + // define the local list for v1_api_service_status->conditions + list_t *conditionsList = NULL; + // v1_api_service_status->conditions cJSON *conditions = cJSON_GetObjectItemCaseSensitive(v1_api_service_statusJSON, "conditions"); - list_t *conditionsList; if (conditions) { - cJSON *conditions_local_nonprimitive; + cJSON *conditions_local_nonprimitive = NULL; if(!cJSON_IsArray(conditions)){ goto end; //nonprimitive container } @@ -96,6 +98,15 @@ v1_api_service_status_t *v1_api_service_status_parseFromJSON(cJSON *v1_api_servi return v1_api_service_status_local_var; end: + if (conditionsList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, conditionsList) { + v1_api_service_condition_free(listEntry->data); + listEntry->data = NULL; + } + list_freeList(conditionsList); + conditionsList = NULL; + } return NULL; } diff --git a/kubernetes/model/v1_api_versions.c b/kubernetes/model/v1_api_versions.c index beb78769..4fc6edf3 100644 --- a/kubernetes/model/v1_api_versions.c +++ b/kubernetes/model/v1_api_versions.c @@ -125,6 +125,12 @@ v1_api_versions_t *v1_api_versions_parseFromJSON(cJSON *v1_api_versionsJSON){ v1_api_versions_t *v1_api_versions_local_var = NULL; + // define the local list for v1_api_versions->server_address_by_client_cidrs + list_t *server_address_by_client_cidrsList = NULL; + + // define the local list for v1_api_versions->versions + list_t *versionsList = NULL; + // v1_api_versions->api_version cJSON *api_version = cJSON_GetObjectItemCaseSensitive(v1_api_versionsJSON, "apiVersion"); if (api_version) { @@ -149,9 +155,8 @@ v1_api_versions_t *v1_api_versions_parseFromJSON(cJSON *v1_api_versionsJSON){ goto end; } - list_t *server_address_by_client_cidrsList; - cJSON *server_address_by_client_cidrs_local_nonprimitive; + cJSON *server_address_by_client_cidrs_local_nonprimitive = NULL; if(!cJSON_IsArray(server_address_by_client_cidrs)){ goto end; //nonprimitive container } @@ -174,9 +179,8 @@ v1_api_versions_t *v1_api_versions_parseFromJSON(cJSON *v1_api_versionsJSON){ goto end; } - list_t *versionsList; - cJSON *versions_local; + cJSON *versions_local = NULL; if(!cJSON_IsArray(versions)) { goto end;//primitive container } @@ -201,6 +205,24 @@ v1_api_versions_t *v1_api_versions_parseFromJSON(cJSON *v1_api_versionsJSON){ return v1_api_versions_local_var; end: + if (server_address_by_client_cidrsList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, server_address_by_client_cidrsList) { + v1_server_address_by_client_cidr_free(listEntry->data); + listEntry->data = NULL; + } + list_freeList(server_address_by_client_cidrsList); + server_address_by_client_cidrsList = NULL; + } + if (versionsList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, versionsList) { + free(listEntry->data); + listEntry->data = NULL; + } + list_freeList(versionsList); + versionsList = NULL; + } return NULL; } diff --git a/kubernetes/model/v1_capabilities.c b/kubernetes/model/v1_capabilities.c index 720a7c57..dc96d8a1 100644 --- a/kubernetes/model/v1_capabilities.c +++ b/kubernetes/model/v1_capabilities.c @@ -90,11 +90,16 @@ v1_capabilities_t *v1_capabilities_parseFromJSON(cJSON *v1_capabilitiesJSON){ v1_capabilities_t *v1_capabilities_local_var = NULL; + // define the local list for v1_capabilities->add + list_t *addList = NULL; + + // define the local list for v1_capabilities->drop + list_t *dropList = NULL; + // v1_capabilities->add cJSON *add = cJSON_GetObjectItemCaseSensitive(v1_capabilitiesJSON, "add"); - list_t *addList; if (add) { - cJSON *add_local; + cJSON *add_local = NULL; if(!cJSON_IsArray(add)) { goto end;//primitive container } @@ -112,9 +117,8 @@ v1_capabilities_t *v1_capabilities_parseFromJSON(cJSON *v1_capabilitiesJSON){ // v1_capabilities->drop cJSON *drop = cJSON_GetObjectItemCaseSensitive(v1_capabilitiesJSON, "drop"); - list_t *dropList; if (drop) { - cJSON *drop_local; + cJSON *drop_local = NULL; if(!cJSON_IsArray(drop)) { goto end;//primitive container } @@ -138,6 +142,24 @@ v1_capabilities_t *v1_capabilities_parseFromJSON(cJSON *v1_capabilitiesJSON){ return v1_capabilities_local_var; end: + if (addList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, addList) { + free(listEntry->data); + listEntry->data = NULL; + } + list_freeList(addList); + addList = NULL; + } + if (dropList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, dropList) { + free(listEntry->data); + listEntry->data = NULL; + } + list_freeList(dropList); + dropList = NULL; + } return NULL; } diff --git a/kubernetes/model/v1_ceph_fs_persistent_volume_source.c b/kubernetes/model/v1_ceph_fs_persistent_volume_source.c index 35baeded..7e8e98b3 100644 --- a/kubernetes/model/v1_ceph_fs_persistent_volume_source.c +++ b/kubernetes/model/v1_ceph_fs_persistent_volume_source.c @@ -137,6 +137,9 @@ v1_ceph_fs_persistent_volume_source_t *v1_ceph_fs_persistent_volume_source_parse v1_ceph_fs_persistent_volume_source_t *v1_ceph_fs_persistent_volume_source_local_var = NULL; + // define the local list for v1_ceph_fs_persistent_volume_source->monitors + list_t *monitorsList = NULL; + // define the local variable for v1_ceph_fs_persistent_volume_source->secret_ref v1_secret_reference_t *secret_ref_local_nonprim = NULL; @@ -146,9 +149,8 @@ v1_ceph_fs_persistent_volume_source_t *v1_ceph_fs_persistent_volume_source_parse goto end; } - list_t *monitorsList; - cJSON *monitors_local; + cJSON *monitors_local = NULL; if(!cJSON_IsArray(monitors)) { goto end;//primitive container } @@ -217,6 +219,15 @@ v1_ceph_fs_persistent_volume_source_t *v1_ceph_fs_persistent_volume_source_parse return v1_ceph_fs_persistent_volume_source_local_var; end: + if (monitorsList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, monitorsList) { + free(listEntry->data); + listEntry->data = NULL; + } + list_freeList(monitorsList); + monitorsList = NULL; + } if (secret_ref_local_nonprim) { v1_secret_reference_free(secret_ref_local_nonprim); secret_ref_local_nonprim = NULL; diff --git a/kubernetes/model/v1_ceph_fs_volume_source.c b/kubernetes/model/v1_ceph_fs_volume_source.c index d7cfe174..cc4ffa12 100644 --- a/kubernetes/model/v1_ceph_fs_volume_source.c +++ b/kubernetes/model/v1_ceph_fs_volume_source.c @@ -137,6 +137,9 @@ v1_ceph_fs_volume_source_t *v1_ceph_fs_volume_source_parseFromJSON(cJSON *v1_cep v1_ceph_fs_volume_source_t *v1_ceph_fs_volume_source_local_var = NULL; + // define the local list for v1_ceph_fs_volume_source->monitors + list_t *monitorsList = NULL; + // define the local variable for v1_ceph_fs_volume_source->secret_ref v1_local_object_reference_t *secret_ref_local_nonprim = NULL; @@ -146,9 +149,8 @@ v1_ceph_fs_volume_source_t *v1_ceph_fs_volume_source_parseFromJSON(cJSON *v1_cep goto end; } - list_t *monitorsList; - cJSON *monitors_local; + cJSON *monitors_local = NULL; if(!cJSON_IsArray(monitors)) { goto end;//primitive container } @@ -217,6 +219,15 @@ v1_ceph_fs_volume_source_t *v1_ceph_fs_volume_source_parseFromJSON(cJSON *v1_cep return v1_ceph_fs_volume_source_local_var; end: + if (monitorsList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, monitorsList) { + free(listEntry->data); + listEntry->data = NULL; + } + list_freeList(monitorsList); + monitorsList = NULL; + } if (secret_ref_local_nonprim) { v1_local_object_reference_free(secret_ref_local_nonprim); secret_ref_local_nonprim = NULL; diff --git a/kubernetes/model/v1_certificate_signing_request_list.c b/kubernetes/model/v1_certificate_signing_request_list.c index 30a2f709..30810345 100644 --- a/kubernetes/model/v1_certificate_signing_request_list.c +++ b/kubernetes/model/v1_certificate_signing_request_list.c @@ -116,6 +116,9 @@ v1_certificate_signing_request_list_t *v1_certificate_signing_request_list_parse v1_certificate_signing_request_list_t *v1_certificate_signing_request_list_local_var = NULL; + // define the local list for v1_certificate_signing_request_list->items + list_t *itemsList = NULL; + // define the local variable for v1_certificate_signing_request_list->metadata v1_list_meta_t *metadata_local_nonprim = NULL; @@ -134,9 +137,8 @@ v1_certificate_signing_request_list_t *v1_certificate_signing_request_list_parse goto end; } - list_t *itemsList; - cJSON *items_local_nonprimitive; + cJSON *items_local_nonprimitive = NULL; if(!cJSON_IsArray(items)){ goto end; //nonprimitive container } @@ -178,6 +180,15 @@ v1_certificate_signing_request_list_t *v1_certificate_signing_request_list_parse return v1_certificate_signing_request_list_local_var; end: + if (itemsList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, itemsList) { + v1_certificate_signing_request_free(listEntry->data); + listEntry->data = NULL; + } + list_freeList(itemsList); + itemsList = NULL; + } if (metadata_local_nonprim) { v1_list_meta_free(metadata_local_nonprim); metadata_local_nonprim = NULL; diff --git a/kubernetes/model/v1_certificate_signing_request_spec.c b/kubernetes/model/v1_certificate_signing_request_spec.c index 3afcf43a..5300456f 100644 --- a/kubernetes/model/v1_certificate_signing_request_spec.c +++ b/kubernetes/model/v1_certificate_signing_request_spec.c @@ -188,6 +188,15 @@ v1_certificate_signing_request_spec_t *v1_certificate_signing_request_spec_parse v1_certificate_signing_request_spec_t *v1_certificate_signing_request_spec_local_var = NULL; + // define the local map for v1_certificate_signing_request_spec->extra + list_t *extraList = NULL; + + // define the local list for v1_certificate_signing_request_spec->groups + list_t *groupsList = NULL; + + // define the local list for v1_certificate_signing_request_spec->usages + list_t *usagesList = NULL; + // v1_certificate_signing_request_spec->expiration_seconds cJSON *expiration_seconds = cJSON_GetObjectItemCaseSensitive(v1_certificate_signing_request_specJSON, "expirationSeconds"); if (expiration_seconds) { @@ -199,9 +208,8 @@ v1_certificate_signing_request_spec_t *v1_certificate_signing_request_spec_parse // v1_certificate_signing_request_spec->extra cJSON *extra = cJSON_GetObjectItemCaseSensitive(v1_certificate_signing_request_specJSON, "extra"); - list_t *extraList; if (extra) { - cJSON *extra_local_map; + cJSON *extra_local_map = NULL; if(!cJSON_IsObject(extra)) { goto end;//primitive map container } @@ -216,9 +224,8 @@ v1_certificate_signing_request_spec_t *v1_certificate_signing_request_spec_parse // v1_certificate_signing_request_spec->groups cJSON *groups = cJSON_GetObjectItemCaseSensitive(v1_certificate_signing_request_specJSON, "groups"); - list_t *groupsList; if (groups) { - cJSON *groups_local; + cJSON *groups_local = NULL; if(!cJSON_IsArray(groups)) { goto end;//primitive container } @@ -269,9 +276,8 @@ v1_certificate_signing_request_spec_t *v1_certificate_signing_request_spec_parse // v1_certificate_signing_request_spec->usages cJSON *usages = cJSON_GetObjectItemCaseSensitive(v1_certificate_signing_request_specJSON, "usages"); - list_t *usagesList; if (usages) { - cJSON *usages_local; + cJSON *usages_local = NULL; if(!cJSON_IsArray(usages)) { goto end;//primitive container } @@ -310,6 +316,36 @@ v1_certificate_signing_request_spec_t *v1_certificate_signing_request_spec_parse return v1_certificate_signing_request_spec_local_var; end: + if (extraList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, extraList) { + keyValuePair_t *localKeyValue = (keyValuePair_t*) listEntry->data; + free(localKeyValue->key); + localKeyValue->key = NULL; + keyValuePair_free(localKeyValue); + localKeyValue = NULL; + } + list_freeList(extraList); + extraList = NULL; + } + if (groupsList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, groupsList) { + free(listEntry->data); + listEntry->data = NULL; + } + list_freeList(groupsList); + groupsList = NULL; + } + if (usagesList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, usagesList) { + free(listEntry->data); + listEntry->data = NULL; + } + list_freeList(usagesList); + usagesList = NULL; + } return NULL; } diff --git a/kubernetes/model/v1_certificate_signing_request_status.c b/kubernetes/model/v1_certificate_signing_request_status.c index 824d085b..f8f33fcb 100644 --- a/kubernetes/model/v1_certificate_signing_request_status.c +++ b/kubernetes/model/v1_certificate_signing_request_status.c @@ -81,6 +81,9 @@ v1_certificate_signing_request_status_t *v1_certificate_signing_request_status_p v1_certificate_signing_request_status_t *v1_certificate_signing_request_status_local_var = NULL; + // define the local list for v1_certificate_signing_request_status->conditions + list_t *conditionsList = NULL; + // v1_certificate_signing_request_status->certificate cJSON *certificate = cJSON_GetObjectItemCaseSensitive(v1_certificate_signing_request_statusJSON, "certificate"); if (certificate) { @@ -92,9 +95,8 @@ v1_certificate_signing_request_status_t *v1_certificate_signing_request_status_p // v1_certificate_signing_request_status->conditions cJSON *conditions = cJSON_GetObjectItemCaseSensitive(v1_certificate_signing_request_statusJSON, "conditions"); - list_t *conditionsList; if (conditions) { - cJSON *conditions_local_nonprimitive; + cJSON *conditions_local_nonprimitive = NULL; if(!cJSON_IsArray(conditions)){ goto end; //nonprimitive container } @@ -120,6 +122,15 @@ v1_certificate_signing_request_status_t *v1_certificate_signing_request_status_p return v1_certificate_signing_request_status_local_var; end: + if (conditionsList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, conditionsList) { + v1_certificate_signing_request_condition_free(listEntry->data); + listEntry->data = NULL; + } + list_freeList(conditionsList); + conditionsList = NULL; + } return NULL; } diff --git a/kubernetes/model/v1_cluster_role.c b/kubernetes/model/v1_cluster_role.c index b0b73f4c..464376a1 100644 --- a/kubernetes/model/v1_cluster_role.c +++ b/kubernetes/model/v1_cluster_role.c @@ -139,6 +139,9 @@ v1_cluster_role_t *v1_cluster_role_parseFromJSON(cJSON *v1_cluster_roleJSON){ // define the local variable for v1_cluster_role->metadata v1_object_meta_t *metadata_local_nonprim = NULL; + // define the local list for v1_cluster_role->rules + list_t *rulesList = NULL; + // v1_cluster_role->aggregation_rule cJSON *aggregation_rule = cJSON_GetObjectItemCaseSensitive(v1_cluster_roleJSON, "aggregationRule"); if (aggregation_rule) { @@ -171,9 +174,8 @@ v1_cluster_role_t *v1_cluster_role_parseFromJSON(cJSON *v1_cluster_roleJSON){ // v1_cluster_role->rules cJSON *rules = cJSON_GetObjectItemCaseSensitive(v1_cluster_roleJSON, "rules"); - list_t *rulesList; if (rules) { - cJSON *rules_local_nonprimitive; + cJSON *rules_local_nonprimitive = NULL; if(!cJSON_IsArray(rules)){ goto end; //nonprimitive container } @@ -210,6 +212,15 @@ v1_cluster_role_t *v1_cluster_role_parseFromJSON(cJSON *v1_cluster_roleJSON){ v1_object_meta_free(metadata_local_nonprim); metadata_local_nonprim = NULL; } + if (rulesList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, rulesList) { + v1_policy_rule_free(listEntry->data); + listEntry->data = NULL; + } + list_freeList(rulesList); + rulesList = NULL; + } return NULL; } diff --git a/kubernetes/model/v1_cluster_role_binding.c b/kubernetes/model/v1_cluster_role_binding.c index f0c60584..45b6aec5 100644 --- a/kubernetes/model/v1_cluster_role_binding.c +++ b/kubernetes/model/v1_cluster_role_binding.c @@ -141,6 +141,9 @@ v1_cluster_role_binding_t *v1_cluster_role_binding_parseFromJSON(cJSON *v1_clust // define the local variable for v1_cluster_role_binding->role_ref v1_role_ref_t *role_ref_local_nonprim = NULL; + // define the local list for v1_cluster_role_binding->subjects + list_t *subjectsList = NULL; + // v1_cluster_role_binding->api_version cJSON *api_version = cJSON_GetObjectItemCaseSensitive(v1_cluster_role_bindingJSON, "apiVersion"); if (api_version) { @@ -176,9 +179,8 @@ v1_cluster_role_binding_t *v1_cluster_role_binding_parseFromJSON(cJSON *v1_clust // v1_cluster_role_binding->subjects cJSON *subjects = cJSON_GetObjectItemCaseSensitive(v1_cluster_role_bindingJSON, "subjects"); - list_t *subjectsList; if (subjects) { - cJSON *subjects_local_nonprimitive; + cJSON *subjects_local_nonprimitive = NULL; if(!cJSON_IsArray(subjects)){ goto end; //nonprimitive container } @@ -215,6 +217,15 @@ v1_cluster_role_binding_t *v1_cluster_role_binding_parseFromJSON(cJSON *v1_clust v1_role_ref_free(role_ref_local_nonprim); role_ref_local_nonprim = NULL; } + if (subjectsList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, subjectsList) { + v1_subject_free(listEntry->data); + listEntry->data = NULL; + } + list_freeList(subjectsList); + subjectsList = NULL; + } return NULL; } diff --git a/kubernetes/model/v1_cluster_role_binding_list.c b/kubernetes/model/v1_cluster_role_binding_list.c index 146bcd28..0d9370fe 100644 --- a/kubernetes/model/v1_cluster_role_binding_list.c +++ b/kubernetes/model/v1_cluster_role_binding_list.c @@ -116,6 +116,9 @@ v1_cluster_role_binding_list_t *v1_cluster_role_binding_list_parseFromJSON(cJSON v1_cluster_role_binding_list_t *v1_cluster_role_binding_list_local_var = NULL; + // define the local list for v1_cluster_role_binding_list->items + list_t *itemsList = NULL; + // define the local variable for v1_cluster_role_binding_list->metadata v1_list_meta_t *metadata_local_nonprim = NULL; @@ -134,9 +137,8 @@ v1_cluster_role_binding_list_t *v1_cluster_role_binding_list_parseFromJSON(cJSON goto end; } - list_t *itemsList; - cJSON *items_local_nonprimitive; + cJSON *items_local_nonprimitive = NULL; if(!cJSON_IsArray(items)){ goto end; //nonprimitive container } @@ -178,6 +180,15 @@ v1_cluster_role_binding_list_t *v1_cluster_role_binding_list_parseFromJSON(cJSON return v1_cluster_role_binding_list_local_var; end: + if (itemsList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, itemsList) { + v1_cluster_role_binding_free(listEntry->data); + listEntry->data = NULL; + } + list_freeList(itemsList); + itemsList = NULL; + } if (metadata_local_nonprim) { v1_list_meta_free(metadata_local_nonprim); metadata_local_nonprim = NULL; diff --git a/kubernetes/model/v1_cluster_role_list.c b/kubernetes/model/v1_cluster_role_list.c index e805ae24..34bc5f21 100644 --- a/kubernetes/model/v1_cluster_role_list.c +++ b/kubernetes/model/v1_cluster_role_list.c @@ -116,6 +116,9 @@ v1_cluster_role_list_t *v1_cluster_role_list_parseFromJSON(cJSON *v1_cluster_rol v1_cluster_role_list_t *v1_cluster_role_list_local_var = NULL; + // define the local list for v1_cluster_role_list->items + list_t *itemsList = NULL; + // define the local variable for v1_cluster_role_list->metadata v1_list_meta_t *metadata_local_nonprim = NULL; @@ -134,9 +137,8 @@ v1_cluster_role_list_t *v1_cluster_role_list_parseFromJSON(cJSON *v1_cluster_rol goto end; } - list_t *itemsList; - cJSON *items_local_nonprimitive; + cJSON *items_local_nonprimitive = NULL; if(!cJSON_IsArray(items)){ goto end; //nonprimitive container } @@ -178,6 +180,15 @@ v1_cluster_role_list_t *v1_cluster_role_list_parseFromJSON(cJSON *v1_cluster_rol return v1_cluster_role_list_local_var; end: + if (itemsList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, itemsList) { + v1_cluster_role_free(listEntry->data); + listEntry->data = NULL; + } + list_freeList(itemsList); + itemsList = NULL; + } if (metadata_local_nonprim) { v1_list_meta_free(metadata_local_nonprim); metadata_local_nonprim = NULL; diff --git a/kubernetes/model/v1_component_status.c b/kubernetes/model/v1_component_status.c index 0f5cde98..f4d414a8 100644 --- a/kubernetes/model/v1_component_status.c +++ b/kubernetes/model/v1_component_status.c @@ -114,6 +114,9 @@ v1_component_status_t *v1_component_status_parseFromJSON(cJSON *v1_component_sta v1_component_status_t *v1_component_status_local_var = NULL; + // define the local list for v1_component_status->conditions + list_t *conditionsList = NULL; + // define the local variable for v1_component_status->metadata v1_object_meta_t *metadata_local_nonprim = NULL; @@ -128,9 +131,8 @@ v1_component_status_t *v1_component_status_parseFromJSON(cJSON *v1_component_sta // v1_component_status->conditions cJSON *conditions = cJSON_GetObjectItemCaseSensitive(v1_component_statusJSON, "conditions"); - list_t *conditionsList; if (conditions) { - cJSON *conditions_local_nonprimitive; + cJSON *conditions_local_nonprimitive = NULL; if(!cJSON_IsArray(conditions)){ goto end; //nonprimitive container } @@ -173,6 +175,15 @@ v1_component_status_t *v1_component_status_parseFromJSON(cJSON *v1_component_sta return v1_component_status_local_var; end: + if (conditionsList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, conditionsList) { + v1_component_condition_free(listEntry->data); + listEntry->data = NULL; + } + list_freeList(conditionsList); + conditionsList = NULL; + } if (metadata_local_nonprim) { v1_object_meta_free(metadata_local_nonprim); metadata_local_nonprim = NULL; diff --git a/kubernetes/model/v1_component_status_list.c b/kubernetes/model/v1_component_status_list.c index d54bcbd9..2a82b79d 100644 --- a/kubernetes/model/v1_component_status_list.c +++ b/kubernetes/model/v1_component_status_list.c @@ -116,6 +116,9 @@ v1_component_status_list_t *v1_component_status_list_parseFromJSON(cJSON *v1_com v1_component_status_list_t *v1_component_status_list_local_var = NULL; + // define the local list for v1_component_status_list->items + list_t *itemsList = NULL; + // define the local variable for v1_component_status_list->metadata v1_list_meta_t *metadata_local_nonprim = NULL; @@ -134,9 +137,8 @@ v1_component_status_list_t *v1_component_status_list_parseFromJSON(cJSON *v1_com goto end; } - list_t *itemsList; - cJSON *items_local_nonprimitive; + cJSON *items_local_nonprimitive = NULL; if(!cJSON_IsArray(items)){ goto end; //nonprimitive container } @@ -178,6 +180,15 @@ v1_component_status_list_t *v1_component_status_list_parseFromJSON(cJSON *v1_com return v1_component_status_list_local_var; end: + if (itemsList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, itemsList) { + v1_component_status_free(listEntry->data); + listEntry->data = NULL; + } + list_freeList(itemsList); + itemsList = NULL; + } if (metadata_local_nonprim) { v1_list_meta_free(metadata_local_nonprim); metadata_local_nonprim = NULL; diff --git a/kubernetes/model/v1_config_map.c b/kubernetes/model/v1_config_map.c index cbff06f6..6ba12e10 100644 --- a/kubernetes/model/v1_config_map.c +++ b/kubernetes/model/v1_config_map.c @@ -159,6 +159,12 @@ v1_config_map_t *v1_config_map_parseFromJSON(cJSON *v1_config_mapJSON){ v1_config_map_t *v1_config_map_local_var = NULL; + // define the local map for v1_config_map->binary_data + list_t *binary_dataList = NULL; + + // define the local map for v1_config_map->data + list_t *dataList = NULL; + // define the local variable for v1_config_map->metadata v1_object_meta_t *metadata_local_nonprim = NULL; @@ -173,9 +179,8 @@ v1_config_map_t *v1_config_map_parseFromJSON(cJSON *v1_config_mapJSON){ // v1_config_map->binary_data cJSON *binary_data = cJSON_GetObjectItemCaseSensitive(v1_config_mapJSON, "binaryData"); - list_t *binary_dataList; if (binary_data) { - cJSON *binary_data_local_map; + cJSON *binary_data_local_map = NULL; if(!cJSON_IsObject(binary_data)) { goto end;//primitive map container } @@ -195,9 +200,8 @@ v1_config_map_t *v1_config_map_parseFromJSON(cJSON *v1_config_mapJSON){ // v1_config_map->data cJSON *data = cJSON_GetObjectItemCaseSensitive(v1_config_mapJSON, "data"); - list_t *dataList; if (data) { - cJSON *data_local_map; + cJSON *data_local_map = NULL; if(!cJSON_IsObject(data)) { goto end;//primitive map container } @@ -251,6 +255,34 @@ v1_config_map_t *v1_config_map_parseFromJSON(cJSON *v1_config_mapJSON){ return v1_config_map_local_var; end: + if (binary_dataList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, binary_dataList) { + keyValuePair_t *localKeyValue = (keyValuePair_t*) listEntry->data; + free(localKeyValue->key); + localKeyValue->key = NULL; + free(localKeyValue->value); + localKeyValue->value = NULL; + keyValuePair_free(localKeyValue); + localKeyValue = NULL; + } + list_freeList(binary_dataList); + binary_dataList = NULL; + } + if (dataList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, dataList) { + keyValuePair_t *localKeyValue = (keyValuePair_t*) listEntry->data; + free(localKeyValue->key); + localKeyValue->key = NULL; + free(localKeyValue->value); + localKeyValue->value = NULL; + keyValuePair_free(localKeyValue); + localKeyValue = NULL; + } + list_freeList(dataList); + dataList = NULL; + } if (metadata_local_nonprim) { v1_object_meta_free(metadata_local_nonprim); metadata_local_nonprim = NULL; diff --git a/kubernetes/model/v1_config_map_list.c b/kubernetes/model/v1_config_map_list.c index bdd36906..c4c5b9b7 100644 --- a/kubernetes/model/v1_config_map_list.c +++ b/kubernetes/model/v1_config_map_list.c @@ -116,6 +116,9 @@ v1_config_map_list_t *v1_config_map_list_parseFromJSON(cJSON *v1_config_map_list v1_config_map_list_t *v1_config_map_list_local_var = NULL; + // define the local list for v1_config_map_list->items + list_t *itemsList = NULL; + // define the local variable for v1_config_map_list->metadata v1_list_meta_t *metadata_local_nonprim = NULL; @@ -134,9 +137,8 @@ v1_config_map_list_t *v1_config_map_list_parseFromJSON(cJSON *v1_config_map_list goto end; } - list_t *itemsList; - cJSON *items_local_nonprimitive; + cJSON *items_local_nonprimitive = NULL; if(!cJSON_IsArray(items)){ goto end; //nonprimitive container } @@ -178,6 +180,15 @@ v1_config_map_list_t *v1_config_map_list_parseFromJSON(cJSON *v1_config_map_list return v1_config_map_list_local_var; end: + if (itemsList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, itemsList) { + v1_config_map_free(listEntry->data); + listEntry->data = NULL; + } + list_freeList(itemsList); + itemsList = NULL; + } if (metadata_local_nonprim) { v1_list_meta_free(metadata_local_nonprim); metadata_local_nonprim = NULL; diff --git a/kubernetes/model/v1_config_map_projection.c b/kubernetes/model/v1_config_map_projection.c index eb58b12b..38e162ce 100644 --- a/kubernetes/model/v1_config_map_projection.c +++ b/kubernetes/model/v1_config_map_projection.c @@ -91,11 +91,13 @@ v1_config_map_projection_t *v1_config_map_projection_parseFromJSON(cJSON *v1_con v1_config_map_projection_t *v1_config_map_projection_local_var = NULL; + // define the local list for v1_config_map_projection->items + list_t *itemsList = NULL; + // v1_config_map_projection->items cJSON *items = cJSON_GetObjectItemCaseSensitive(v1_config_map_projectionJSON, "items"); - list_t *itemsList; if (items) { - cJSON *items_local_nonprimitive; + cJSON *items_local_nonprimitive = NULL; if(!cJSON_IsArray(items)){ goto end; //nonprimitive container } @@ -140,6 +142,15 @@ v1_config_map_projection_t *v1_config_map_projection_parseFromJSON(cJSON *v1_con return v1_config_map_projection_local_var; end: + if (itemsList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, itemsList) { + v1_key_to_path_free(listEntry->data); + listEntry->data = NULL; + } + list_freeList(itemsList); + itemsList = NULL; + } return NULL; } diff --git a/kubernetes/model/v1_config_map_volume_source.c b/kubernetes/model/v1_config_map_volume_source.c index 10d03b39..d2726bc3 100644 --- a/kubernetes/model/v1_config_map_volume_source.c +++ b/kubernetes/model/v1_config_map_volume_source.c @@ -101,6 +101,9 @@ v1_config_map_volume_source_t *v1_config_map_volume_source_parseFromJSON(cJSON * v1_config_map_volume_source_t *v1_config_map_volume_source_local_var = NULL; + // define the local list for v1_config_map_volume_source->items + list_t *itemsList = NULL; + // v1_config_map_volume_source->default_mode cJSON *default_mode = cJSON_GetObjectItemCaseSensitive(v1_config_map_volume_sourceJSON, "defaultMode"); if (default_mode) { @@ -112,9 +115,8 @@ v1_config_map_volume_source_t *v1_config_map_volume_source_parseFromJSON(cJSON * // v1_config_map_volume_source->items cJSON *items = cJSON_GetObjectItemCaseSensitive(v1_config_map_volume_sourceJSON, "items"); - list_t *itemsList; if (items) { - cJSON *items_local_nonprimitive; + cJSON *items_local_nonprimitive = NULL; if(!cJSON_IsArray(items)){ goto end; //nonprimitive container } @@ -160,6 +162,15 @@ v1_config_map_volume_source_t *v1_config_map_volume_source_parseFromJSON(cJSON * return v1_config_map_volume_source_local_var; end: + if (itemsList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, itemsList) { + v1_key_to_path_free(listEntry->data); + listEntry->data = NULL; + } + list_freeList(itemsList); + itemsList = NULL; + } return NULL; } diff --git a/kubernetes/model/v1_container.c b/kubernetes/model/v1_container.c index 929e5b2c..89d47e55 100644 --- a/kubernetes/model/v1_container.c +++ b/kubernetes/model/v1_container.c @@ -465,12 +465,27 @@ v1_container_t *v1_container_parseFromJSON(cJSON *v1_containerJSON){ v1_container_t *v1_container_local_var = NULL; + // define the local list for v1_container->args + list_t *argsList = NULL; + + // define the local list for v1_container->command + list_t *commandList = NULL; + + // define the local list for v1_container->env + list_t *envList = NULL; + + // define the local list for v1_container->env_from + list_t *env_fromList = NULL; + // define the local variable for v1_container->lifecycle v1_lifecycle_t *lifecycle_local_nonprim = NULL; // define the local variable for v1_container->liveness_probe v1_probe_t *liveness_probe_local_nonprim = NULL; + // define the local list for v1_container->ports + list_t *portsList = NULL; + // define the local variable for v1_container->readiness_probe v1_probe_t *readiness_probe_local_nonprim = NULL; @@ -483,11 +498,16 @@ v1_container_t *v1_container_parseFromJSON(cJSON *v1_containerJSON){ // define the local variable for v1_container->startup_probe v1_probe_t *startup_probe_local_nonprim = NULL; + // define the local list for v1_container->volume_devices + list_t *volume_devicesList = NULL; + + // define the local list for v1_container->volume_mounts + list_t *volume_mountsList = NULL; + // v1_container->args cJSON *args = cJSON_GetObjectItemCaseSensitive(v1_containerJSON, "args"); - list_t *argsList; if (args) { - cJSON *args_local; + cJSON *args_local = NULL; if(!cJSON_IsArray(args)) { goto end;//primitive container } @@ -505,9 +525,8 @@ v1_container_t *v1_container_parseFromJSON(cJSON *v1_containerJSON){ // v1_container->command cJSON *command = cJSON_GetObjectItemCaseSensitive(v1_containerJSON, "command"); - list_t *commandList; if (command) { - cJSON *command_local; + cJSON *command_local = NULL; if(!cJSON_IsArray(command)) { goto end;//primitive container } @@ -525,9 +544,8 @@ v1_container_t *v1_container_parseFromJSON(cJSON *v1_containerJSON){ // v1_container->env cJSON *env = cJSON_GetObjectItemCaseSensitive(v1_containerJSON, "env"); - list_t *envList; if (env) { - cJSON *env_local_nonprimitive; + cJSON *env_local_nonprimitive = NULL; if(!cJSON_IsArray(env)){ goto end; //nonprimitive container } @@ -547,9 +565,8 @@ v1_container_t *v1_container_parseFromJSON(cJSON *v1_containerJSON){ // v1_container->env_from cJSON *env_from = cJSON_GetObjectItemCaseSensitive(v1_containerJSON, "envFrom"); - list_t *env_fromList; if (env_from) { - cJSON *env_from_local_nonprimitive; + cJSON *env_from_local_nonprimitive = NULL; if(!cJSON_IsArray(env_from)){ goto end; //nonprimitive container } @@ -611,9 +628,8 @@ v1_container_t *v1_container_parseFromJSON(cJSON *v1_containerJSON){ // v1_container->ports cJSON *ports = cJSON_GetObjectItemCaseSensitive(v1_containerJSON, "ports"); - list_t *portsList; if (ports) { - cJSON *ports_local_nonprimitive; + cJSON *ports_local_nonprimitive = NULL; if(!cJSON_IsArray(ports)){ goto end; //nonprimitive container } @@ -702,9 +718,8 @@ v1_container_t *v1_container_parseFromJSON(cJSON *v1_containerJSON){ // v1_container->volume_devices cJSON *volume_devices = cJSON_GetObjectItemCaseSensitive(v1_containerJSON, "volumeDevices"); - list_t *volume_devicesList; if (volume_devices) { - cJSON *volume_devices_local_nonprimitive; + cJSON *volume_devices_local_nonprimitive = NULL; if(!cJSON_IsArray(volume_devices)){ goto end; //nonprimitive container } @@ -724,9 +739,8 @@ v1_container_t *v1_container_parseFromJSON(cJSON *v1_containerJSON){ // v1_container->volume_mounts cJSON *volume_mounts = cJSON_GetObjectItemCaseSensitive(v1_containerJSON, "volumeMounts"); - list_t *volume_mountsList; if (volume_mounts) { - cJSON *volume_mounts_local_nonprimitive; + cJSON *volume_mounts_local_nonprimitive = NULL; if(!cJSON_IsArray(volume_mounts)){ goto end; //nonprimitive container } @@ -781,6 +795,42 @@ v1_container_t *v1_container_parseFromJSON(cJSON *v1_containerJSON){ return v1_container_local_var; end: + if (argsList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, argsList) { + free(listEntry->data); + listEntry->data = NULL; + } + list_freeList(argsList); + argsList = NULL; + } + if (commandList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, commandList) { + free(listEntry->data); + listEntry->data = NULL; + } + list_freeList(commandList); + commandList = NULL; + } + if (envList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, envList) { + v1_env_var_free(listEntry->data); + listEntry->data = NULL; + } + list_freeList(envList); + envList = NULL; + } + if (env_fromList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, env_fromList) { + v1_env_from_source_free(listEntry->data); + listEntry->data = NULL; + } + list_freeList(env_fromList); + env_fromList = NULL; + } if (lifecycle_local_nonprim) { v1_lifecycle_free(lifecycle_local_nonprim); lifecycle_local_nonprim = NULL; @@ -789,6 +839,15 @@ v1_container_t *v1_container_parseFromJSON(cJSON *v1_containerJSON){ v1_probe_free(liveness_probe_local_nonprim); liveness_probe_local_nonprim = NULL; } + if (portsList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, portsList) { + v1_container_port_free(listEntry->data); + listEntry->data = NULL; + } + list_freeList(portsList); + portsList = NULL; + } if (readiness_probe_local_nonprim) { v1_probe_free(readiness_probe_local_nonprim); readiness_probe_local_nonprim = NULL; @@ -805,6 +864,24 @@ v1_container_t *v1_container_parseFromJSON(cJSON *v1_containerJSON){ v1_probe_free(startup_probe_local_nonprim); startup_probe_local_nonprim = NULL; } + if (volume_devicesList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, volume_devicesList) { + v1_volume_device_free(listEntry->data); + listEntry->data = NULL; + } + list_freeList(volume_devicesList); + volume_devicesList = NULL; + } + if (volume_mountsList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, volume_mountsList) { + v1_volume_mount_free(listEntry->data); + listEntry->data = NULL; + } + list_freeList(volume_mountsList); + volume_mountsList = NULL; + } return NULL; } diff --git a/kubernetes/model/v1_container_image.c b/kubernetes/model/v1_container_image.c index c40886a8..abf773c8 100644 --- a/kubernetes/model/v1_container_image.c +++ b/kubernetes/model/v1_container_image.c @@ -74,11 +74,13 @@ v1_container_image_t *v1_container_image_parseFromJSON(cJSON *v1_container_image v1_container_image_t *v1_container_image_local_var = NULL; + // define the local list for v1_container_image->names + list_t *namesList = NULL; + // v1_container_image->names cJSON *names = cJSON_GetObjectItemCaseSensitive(v1_container_imageJSON, "names"); - list_t *namesList; if (names) { - cJSON *names_local; + cJSON *names_local = NULL; if(!cJSON_IsArray(names)) { goto end;//primitive container } @@ -111,6 +113,15 @@ v1_container_image_t *v1_container_image_parseFromJSON(cJSON *v1_container_image return v1_container_image_local_var; end: + if (namesList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, namesList) { + free(listEntry->data); + listEntry->data = NULL; + } + list_freeList(namesList); + namesList = NULL; + } return NULL; } diff --git a/kubernetes/model/v1_controller_revision_list.c b/kubernetes/model/v1_controller_revision_list.c index 4c7d0f25..6156c1c6 100644 --- a/kubernetes/model/v1_controller_revision_list.c +++ b/kubernetes/model/v1_controller_revision_list.c @@ -116,6 +116,9 @@ v1_controller_revision_list_t *v1_controller_revision_list_parseFromJSON(cJSON * v1_controller_revision_list_t *v1_controller_revision_list_local_var = NULL; + // define the local list for v1_controller_revision_list->items + list_t *itemsList = NULL; + // define the local variable for v1_controller_revision_list->metadata v1_list_meta_t *metadata_local_nonprim = NULL; @@ -134,9 +137,8 @@ v1_controller_revision_list_t *v1_controller_revision_list_parseFromJSON(cJSON * goto end; } - list_t *itemsList; - cJSON *items_local_nonprimitive; + cJSON *items_local_nonprimitive = NULL; if(!cJSON_IsArray(items)){ goto end; //nonprimitive container } @@ -178,6 +180,15 @@ v1_controller_revision_list_t *v1_controller_revision_list_parseFromJSON(cJSON * return v1_controller_revision_list_local_var; end: + if (itemsList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, itemsList) { + v1_controller_revision_free(listEntry->data); + listEntry->data = NULL; + } + list_freeList(itemsList); + itemsList = NULL; + } if (metadata_local_nonprim) { v1_list_meta_free(metadata_local_nonprim); metadata_local_nonprim = NULL; diff --git a/kubernetes/model/v1_cron_job_list.c b/kubernetes/model/v1_cron_job_list.c index a2213740..6fa8cee7 100644 --- a/kubernetes/model/v1_cron_job_list.c +++ b/kubernetes/model/v1_cron_job_list.c @@ -116,6 +116,9 @@ v1_cron_job_list_t *v1_cron_job_list_parseFromJSON(cJSON *v1_cron_job_listJSON){ v1_cron_job_list_t *v1_cron_job_list_local_var = NULL; + // define the local list for v1_cron_job_list->items + list_t *itemsList = NULL; + // define the local variable for v1_cron_job_list->metadata v1_list_meta_t *metadata_local_nonprim = NULL; @@ -134,9 +137,8 @@ v1_cron_job_list_t *v1_cron_job_list_parseFromJSON(cJSON *v1_cron_job_listJSON){ goto end; } - list_t *itemsList; - cJSON *items_local_nonprimitive; + cJSON *items_local_nonprimitive = NULL; if(!cJSON_IsArray(items)){ goto end; //nonprimitive container } @@ -178,6 +180,15 @@ v1_cron_job_list_t *v1_cron_job_list_parseFromJSON(cJSON *v1_cron_job_listJSON){ return v1_cron_job_list_local_var; end: + if (itemsList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, itemsList) { + v1_cron_job_free(listEntry->data); + listEntry->data = NULL; + } + list_freeList(itemsList); + itemsList = NULL; + } if (metadata_local_nonprim) { v1_list_meta_free(metadata_local_nonprim); metadata_local_nonprim = NULL; diff --git a/kubernetes/model/v1_cron_job_status.c b/kubernetes/model/v1_cron_job_status.c index 2d01cc7f..53e1b6a1 100644 --- a/kubernetes/model/v1_cron_job_status.c +++ b/kubernetes/model/v1_cron_job_status.c @@ -95,11 +95,13 @@ v1_cron_job_status_t *v1_cron_job_status_parseFromJSON(cJSON *v1_cron_job_status v1_cron_job_status_t *v1_cron_job_status_local_var = NULL; + // define the local list for v1_cron_job_status->active + list_t *activeList = NULL; + // v1_cron_job_status->active cJSON *active = cJSON_GetObjectItemCaseSensitive(v1_cron_job_statusJSON, "active"); - list_t *activeList; if (active) { - cJSON *active_local_nonprimitive; + cJSON *active_local_nonprimitive = NULL; if(!cJSON_IsArray(active)){ goto end; //nonprimitive container } @@ -144,6 +146,15 @@ v1_cron_job_status_t *v1_cron_job_status_parseFromJSON(cJSON *v1_cron_job_status return v1_cron_job_status_local_var; end: + if (activeList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, activeList) { + v1_object_reference_free(listEntry->data); + listEntry->data = NULL; + } + list_freeList(activeList); + activeList = NULL; + } return NULL; } diff --git a/kubernetes/model/v1_csi_driver_list.c b/kubernetes/model/v1_csi_driver_list.c index 9e0619a7..9e6013c9 100644 --- a/kubernetes/model/v1_csi_driver_list.c +++ b/kubernetes/model/v1_csi_driver_list.c @@ -116,6 +116,9 @@ v1_csi_driver_list_t *v1_csi_driver_list_parseFromJSON(cJSON *v1_csi_driver_list v1_csi_driver_list_t *v1_csi_driver_list_local_var = NULL; + // define the local list for v1_csi_driver_list->items + list_t *itemsList = NULL; + // define the local variable for v1_csi_driver_list->metadata v1_list_meta_t *metadata_local_nonprim = NULL; @@ -134,9 +137,8 @@ v1_csi_driver_list_t *v1_csi_driver_list_parseFromJSON(cJSON *v1_csi_driver_list goto end; } - list_t *itemsList; - cJSON *items_local_nonprimitive; + cJSON *items_local_nonprimitive = NULL; if(!cJSON_IsArray(items)){ goto end; //nonprimitive container } @@ -178,6 +180,15 @@ v1_csi_driver_list_t *v1_csi_driver_list_parseFromJSON(cJSON *v1_csi_driver_list return v1_csi_driver_list_local_var; end: + if (itemsList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, itemsList) { + v1_csi_driver_free(listEntry->data); + listEntry->data = NULL; + } + list_freeList(itemsList); + itemsList = NULL; + } if (metadata_local_nonprim) { v1_list_meta_free(metadata_local_nonprim); metadata_local_nonprim = NULL; diff --git a/kubernetes/model/v1_csi_driver_spec.c b/kubernetes/model/v1_csi_driver_spec.c index ab3f30f0..f8e7b608 100644 --- a/kubernetes/model/v1_csi_driver_spec.c +++ b/kubernetes/model/v1_csi_driver_spec.c @@ -147,6 +147,12 @@ v1_csi_driver_spec_t *v1_csi_driver_spec_parseFromJSON(cJSON *v1_csi_driver_spec v1_csi_driver_spec_t *v1_csi_driver_spec_local_var = NULL; + // define the local list for v1_csi_driver_spec->token_requests + list_t *token_requestsList = NULL; + + // define the local list for v1_csi_driver_spec->volume_lifecycle_modes + list_t *volume_lifecycle_modesList = NULL; + // v1_csi_driver_spec->attach_required cJSON *attach_required = cJSON_GetObjectItemCaseSensitive(v1_csi_driver_specJSON, "attachRequired"); if (attach_required) { @@ -194,9 +200,8 @@ v1_csi_driver_spec_t *v1_csi_driver_spec_parseFromJSON(cJSON *v1_csi_driver_spec // v1_csi_driver_spec->token_requests cJSON *token_requests = cJSON_GetObjectItemCaseSensitive(v1_csi_driver_specJSON, "tokenRequests"); - list_t *token_requestsList; if (token_requests) { - cJSON *token_requests_local_nonprimitive; + cJSON *token_requests_local_nonprimitive = NULL; if(!cJSON_IsArray(token_requests)){ goto end; //nonprimitive container } @@ -216,9 +221,8 @@ v1_csi_driver_spec_t *v1_csi_driver_spec_parseFromJSON(cJSON *v1_csi_driver_spec // v1_csi_driver_spec->volume_lifecycle_modes cJSON *volume_lifecycle_modes = cJSON_GetObjectItemCaseSensitive(v1_csi_driver_specJSON, "volumeLifecycleModes"); - list_t *volume_lifecycle_modesList; if (volume_lifecycle_modes) { - cJSON *volume_lifecycle_modes_local; + cJSON *volume_lifecycle_modes_local = NULL; if(!cJSON_IsArray(volume_lifecycle_modes)) { goto end;//primitive container } @@ -247,6 +251,24 @@ v1_csi_driver_spec_t *v1_csi_driver_spec_parseFromJSON(cJSON *v1_csi_driver_spec return v1_csi_driver_spec_local_var; end: + if (token_requestsList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, token_requestsList) { + storage_v1_token_request_free(listEntry->data); + listEntry->data = NULL; + } + list_freeList(token_requestsList); + token_requestsList = NULL; + } + if (volume_lifecycle_modesList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, volume_lifecycle_modesList) { + free(listEntry->data); + listEntry->data = NULL; + } + list_freeList(volume_lifecycle_modesList); + volume_lifecycle_modesList = NULL; + } return NULL; } diff --git a/kubernetes/model/v1_csi_node_driver.c b/kubernetes/model/v1_csi_node_driver.c index 350173ef..2dce00b6 100644 --- a/kubernetes/model/v1_csi_node_driver.c +++ b/kubernetes/model/v1_csi_node_driver.c @@ -118,6 +118,9 @@ v1_csi_node_driver_t *v1_csi_node_driver_parseFromJSON(cJSON *v1_csi_node_driver // define the local variable for v1_csi_node_driver->allocatable v1_volume_node_resources_t *allocatable_local_nonprim = NULL; + // define the local list for v1_csi_node_driver->topology_keys + list_t *topology_keysList = NULL; + // v1_csi_node_driver->allocatable cJSON *allocatable = cJSON_GetObjectItemCaseSensitive(v1_csi_node_driverJSON, "allocatable"); if (allocatable) { @@ -150,9 +153,8 @@ v1_csi_node_driver_t *v1_csi_node_driver_parseFromJSON(cJSON *v1_csi_node_driver // v1_csi_node_driver->topology_keys cJSON *topology_keys = cJSON_GetObjectItemCaseSensitive(v1_csi_node_driverJSON, "topologyKeys"); - list_t *topology_keysList; if (topology_keys) { - cJSON *topology_keys_local; + cJSON *topology_keys_local = NULL; if(!cJSON_IsArray(topology_keys)) { goto end;//primitive container } @@ -182,6 +184,15 @@ v1_csi_node_driver_t *v1_csi_node_driver_parseFromJSON(cJSON *v1_csi_node_driver v1_volume_node_resources_free(allocatable_local_nonprim); allocatable_local_nonprim = NULL; } + if (topology_keysList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, topology_keysList) { + free(listEntry->data); + listEntry->data = NULL; + } + list_freeList(topology_keysList); + topology_keysList = NULL; + } return NULL; } diff --git a/kubernetes/model/v1_csi_node_list.c b/kubernetes/model/v1_csi_node_list.c index f263e0b9..b1f2a877 100644 --- a/kubernetes/model/v1_csi_node_list.c +++ b/kubernetes/model/v1_csi_node_list.c @@ -116,6 +116,9 @@ v1_csi_node_list_t *v1_csi_node_list_parseFromJSON(cJSON *v1_csi_node_listJSON){ v1_csi_node_list_t *v1_csi_node_list_local_var = NULL; + // define the local list for v1_csi_node_list->items + list_t *itemsList = NULL; + // define the local variable for v1_csi_node_list->metadata v1_list_meta_t *metadata_local_nonprim = NULL; @@ -134,9 +137,8 @@ v1_csi_node_list_t *v1_csi_node_list_parseFromJSON(cJSON *v1_csi_node_listJSON){ goto end; } - list_t *itemsList; - cJSON *items_local_nonprimitive; + cJSON *items_local_nonprimitive = NULL; if(!cJSON_IsArray(items)){ goto end; //nonprimitive container } @@ -178,6 +180,15 @@ v1_csi_node_list_t *v1_csi_node_list_parseFromJSON(cJSON *v1_csi_node_listJSON){ return v1_csi_node_list_local_var; end: + if (itemsList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, itemsList) { + v1_csi_node_free(listEntry->data); + listEntry->data = NULL; + } + list_freeList(itemsList); + itemsList = NULL; + } if (metadata_local_nonprim) { v1_list_meta_free(metadata_local_nonprim); metadata_local_nonprim = NULL; diff --git a/kubernetes/model/v1_csi_node_spec.c b/kubernetes/model/v1_csi_node_spec.c index 7fd0ae11..5668a286 100644 --- a/kubernetes/model/v1_csi_node_spec.c +++ b/kubernetes/model/v1_csi_node_spec.c @@ -69,15 +69,17 @@ v1_csi_node_spec_t *v1_csi_node_spec_parseFromJSON(cJSON *v1_csi_node_specJSON){ v1_csi_node_spec_t *v1_csi_node_spec_local_var = NULL; + // define the local list for v1_csi_node_spec->drivers + list_t *driversList = NULL; + // v1_csi_node_spec->drivers cJSON *drivers = cJSON_GetObjectItemCaseSensitive(v1_csi_node_specJSON, "drivers"); if (!drivers) { goto end; } - list_t *driversList; - cJSON *drivers_local_nonprimitive; + cJSON *drivers_local_nonprimitive = NULL; if(!cJSON_IsArray(drivers)){ goto end; //nonprimitive container } @@ -101,6 +103,15 @@ v1_csi_node_spec_t *v1_csi_node_spec_parseFromJSON(cJSON *v1_csi_node_specJSON){ return v1_csi_node_spec_local_var; end: + if (driversList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, driversList) { + v1_csi_node_driver_free(listEntry->data); + listEntry->data = NULL; + } + list_freeList(driversList); + driversList = NULL; + } return NULL; } diff --git a/kubernetes/model/v1_csi_persistent_volume_source.c b/kubernetes/model/v1_csi_persistent_volume_source.c index 62431def..6e72c046 100644 --- a/kubernetes/model/v1_csi_persistent_volume_source.c +++ b/kubernetes/model/v1_csi_persistent_volume_source.c @@ -214,6 +214,9 @@ v1_csi_persistent_volume_source_t *v1_csi_persistent_volume_source_parseFromJSON // define the local variable for v1_csi_persistent_volume_source->node_stage_secret_ref v1_secret_reference_t *node_stage_secret_ref_local_nonprim = NULL; + // define the local map for v1_csi_persistent_volume_source->volume_attributes + list_t *volume_attributesList = NULL; + // v1_csi_persistent_volume_source->controller_expand_secret_ref cJSON *controller_expand_secret_ref = cJSON_GetObjectItemCaseSensitive(v1_csi_persistent_volume_sourceJSON, "controllerExpandSecretRef"); if (controller_expand_secret_ref) { @@ -270,9 +273,8 @@ v1_csi_persistent_volume_source_t *v1_csi_persistent_volume_source_parseFromJSON // v1_csi_persistent_volume_source->volume_attributes cJSON *volume_attributes = cJSON_GetObjectItemCaseSensitive(v1_csi_persistent_volume_sourceJSON, "volumeAttributes"); - list_t *volume_attributesList; if (volume_attributes) { - cJSON *volume_attributes_local_map; + cJSON *volume_attributes_local_map = NULL; if(!cJSON_IsObject(volume_attributes)) { goto end;//primitive map container } @@ -333,6 +335,20 @@ v1_csi_persistent_volume_source_t *v1_csi_persistent_volume_source_parseFromJSON v1_secret_reference_free(node_stage_secret_ref_local_nonprim); node_stage_secret_ref_local_nonprim = NULL; } + if (volume_attributesList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, volume_attributesList) { + keyValuePair_t *localKeyValue = (keyValuePair_t*) listEntry->data; + free(localKeyValue->key); + localKeyValue->key = NULL; + free(localKeyValue->value); + localKeyValue->value = NULL; + keyValuePair_free(localKeyValue); + localKeyValue = NULL; + } + list_freeList(volume_attributesList); + volume_attributesList = NULL; + } return NULL; } diff --git a/kubernetes/model/v1_csi_volume_source.c b/kubernetes/model/v1_csi_volume_source.c index f001358a..95964f7e 100644 --- a/kubernetes/model/v1_csi_volume_source.c +++ b/kubernetes/model/v1_csi_volume_source.c @@ -132,6 +132,9 @@ v1_csi_volume_source_t *v1_csi_volume_source_parseFromJSON(cJSON *v1_csi_volume_ // define the local variable for v1_csi_volume_source->node_publish_secret_ref v1_local_object_reference_t *node_publish_secret_ref_local_nonprim = NULL; + // define the local map for v1_csi_volume_source->volume_attributes + list_t *volume_attributesList = NULL; + // v1_csi_volume_source->driver cJSON *driver = cJSON_GetObjectItemCaseSensitive(v1_csi_volume_sourceJSON, "driver"); if (!driver) { @@ -170,9 +173,8 @@ v1_csi_volume_source_t *v1_csi_volume_source_parseFromJSON(cJSON *v1_csi_volume_ // v1_csi_volume_source->volume_attributes cJSON *volume_attributes = cJSON_GetObjectItemCaseSensitive(v1_csi_volume_sourceJSON, "volumeAttributes"); - list_t *volume_attributesList; if (volume_attributes) { - cJSON *volume_attributes_local_map; + cJSON *volume_attributes_local_map = NULL; if(!cJSON_IsObject(volume_attributes)) { goto end;//primitive map container } @@ -205,6 +207,20 @@ v1_csi_volume_source_t *v1_csi_volume_source_parseFromJSON(cJSON *v1_csi_volume_ v1_local_object_reference_free(node_publish_secret_ref_local_nonprim); node_publish_secret_ref_local_nonprim = NULL; } + if (volume_attributesList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, volume_attributesList) { + keyValuePair_t *localKeyValue = (keyValuePair_t*) listEntry->data; + free(localKeyValue->key); + localKeyValue->key = NULL; + free(localKeyValue->value); + localKeyValue->value = NULL; + keyValuePair_free(localKeyValue); + localKeyValue = NULL; + } + list_freeList(volume_attributesList); + volume_attributesList = NULL; + } return NULL; } diff --git a/kubernetes/model/v1_custom_resource_definition_list.c b/kubernetes/model/v1_custom_resource_definition_list.c index f92a97e8..915fe76f 100644 --- a/kubernetes/model/v1_custom_resource_definition_list.c +++ b/kubernetes/model/v1_custom_resource_definition_list.c @@ -116,6 +116,9 @@ v1_custom_resource_definition_list_t *v1_custom_resource_definition_list_parseFr v1_custom_resource_definition_list_t *v1_custom_resource_definition_list_local_var = NULL; + // define the local list for v1_custom_resource_definition_list->items + list_t *itemsList = NULL; + // define the local variable for v1_custom_resource_definition_list->metadata v1_list_meta_t *metadata_local_nonprim = NULL; @@ -134,9 +137,8 @@ v1_custom_resource_definition_list_t *v1_custom_resource_definition_list_parseFr goto end; } - list_t *itemsList; - cJSON *items_local_nonprimitive; + cJSON *items_local_nonprimitive = NULL; if(!cJSON_IsArray(items)){ goto end; //nonprimitive container } @@ -178,6 +180,15 @@ v1_custom_resource_definition_list_t *v1_custom_resource_definition_list_parseFr return v1_custom_resource_definition_list_local_var; end: + if (itemsList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, itemsList) { + v1_custom_resource_definition_free(listEntry->data); + listEntry->data = NULL; + } + list_freeList(itemsList); + itemsList = NULL; + } if (metadata_local_nonprim) { v1_list_meta_free(metadata_local_nonprim); metadata_local_nonprim = NULL; diff --git a/kubernetes/model/v1_custom_resource_definition_names.c b/kubernetes/model/v1_custom_resource_definition_names.c index e757f3a9..1274cd36 100644 --- a/kubernetes/model/v1_custom_resource_definition_names.c +++ b/kubernetes/model/v1_custom_resource_definition_names.c @@ -150,11 +150,16 @@ v1_custom_resource_definition_names_t *v1_custom_resource_definition_names_parse v1_custom_resource_definition_names_t *v1_custom_resource_definition_names_local_var = NULL; + // define the local list for v1_custom_resource_definition_names->categories + list_t *categoriesList = NULL; + + // define the local list for v1_custom_resource_definition_names->short_names + list_t *short_namesList = NULL; + // v1_custom_resource_definition_names->categories cJSON *categories = cJSON_GetObjectItemCaseSensitive(v1_custom_resource_definition_namesJSON, "categories"); - list_t *categoriesList; if (categories) { - cJSON *categories_local; + cJSON *categories_local = NULL; if(!cJSON_IsArray(categories)) { goto end;//primitive container } @@ -205,9 +210,8 @@ v1_custom_resource_definition_names_t *v1_custom_resource_definition_names_parse // v1_custom_resource_definition_names->short_names cJSON *short_names = cJSON_GetObjectItemCaseSensitive(v1_custom_resource_definition_namesJSON, "shortNames"); - list_t *short_namesList; if (short_names) { - cJSON *short_names_local; + cJSON *short_names_local = NULL; if(!cJSON_IsArray(short_names)) { goto end;//primitive container } @@ -244,6 +248,24 @@ v1_custom_resource_definition_names_t *v1_custom_resource_definition_names_parse return v1_custom_resource_definition_names_local_var; end: + if (categoriesList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, categoriesList) { + free(listEntry->data); + listEntry->data = NULL; + } + list_freeList(categoriesList); + categoriesList = NULL; + } + if (short_namesList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, short_namesList) { + free(listEntry->data); + listEntry->data = NULL; + } + list_freeList(short_namesList); + short_namesList = NULL; + } return NULL; } diff --git a/kubernetes/model/v1_custom_resource_definition_spec.c b/kubernetes/model/v1_custom_resource_definition_spec.c index b2cdb0e9..8f80b1aa 100644 --- a/kubernetes/model/v1_custom_resource_definition_spec.c +++ b/kubernetes/model/v1_custom_resource_definition_spec.c @@ -157,6 +157,9 @@ v1_custom_resource_definition_spec_t *v1_custom_resource_definition_spec_parseFr // define the local variable for v1_custom_resource_definition_spec->names v1_custom_resource_definition_names_t *names_local_nonprim = NULL; + // define the local list for v1_custom_resource_definition_spec->versions + list_t *versionsList = NULL; + // v1_custom_resource_definition_spec->conversion cJSON *conversion = cJSON_GetObjectItemCaseSensitive(v1_custom_resource_definition_specJSON, "conversion"); if (conversion) { @@ -211,9 +214,8 @@ v1_custom_resource_definition_spec_t *v1_custom_resource_definition_spec_parseFr goto end; } - list_t *versionsList; - cJSON *versions_local_nonprimitive; + cJSON *versions_local_nonprimitive = NULL; if(!cJSON_IsArray(versions)){ goto end; //nonprimitive container } @@ -250,6 +252,15 @@ v1_custom_resource_definition_spec_t *v1_custom_resource_definition_spec_parseFr v1_custom_resource_definition_names_free(names_local_nonprim); names_local_nonprim = NULL; } + if (versionsList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, versionsList) { + v1_custom_resource_definition_version_free(listEntry->data); + listEntry->data = NULL; + } + list_freeList(versionsList); + versionsList = NULL; + } return NULL; } diff --git a/kubernetes/model/v1_custom_resource_definition_status.c b/kubernetes/model/v1_custom_resource_definition_status.c index e0d6f673..5f0a1b68 100644 --- a/kubernetes/model/v1_custom_resource_definition_status.c +++ b/kubernetes/model/v1_custom_resource_definition_status.c @@ -115,6 +115,12 @@ v1_custom_resource_definition_status_t *v1_custom_resource_definition_status_par // define the local variable for v1_custom_resource_definition_status->accepted_names v1_custom_resource_definition_names_t *accepted_names_local_nonprim = NULL; + // define the local list for v1_custom_resource_definition_status->conditions + list_t *conditionsList = NULL; + + // define the local list for v1_custom_resource_definition_status->stored_versions + list_t *stored_versionsList = NULL; + // v1_custom_resource_definition_status->accepted_names cJSON *accepted_names = cJSON_GetObjectItemCaseSensitive(v1_custom_resource_definition_statusJSON, "acceptedNames"); if (accepted_names) { @@ -123,9 +129,8 @@ v1_custom_resource_definition_status_t *v1_custom_resource_definition_status_par // v1_custom_resource_definition_status->conditions cJSON *conditions = cJSON_GetObjectItemCaseSensitive(v1_custom_resource_definition_statusJSON, "conditions"); - list_t *conditionsList; if (conditions) { - cJSON *conditions_local_nonprimitive; + cJSON *conditions_local_nonprimitive = NULL; if(!cJSON_IsArray(conditions)){ goto end; //nonprimitive container } @@ -145,9 +150,8 @@ v1_custom_resource_definition_status_t *v1_custom_resource_definition_status_par // v1_custom_resource_definition_status->stored_versions cJSON *stored_versions = cJSON_GetObjectItemCaseSensitive(v1_custom_resource_definition_statusJSON, "storedVersions"); - list_t *stored_versionsList; if (stored_versions) { - cJSON *stored_versions_local; + cJSON *stored_versions_local = NULL; if(!cJSON_IsArray(stored_versions)) { goto end;//primitive container } @@ -176,6 +180,24 @@ v1_custom_resource_definition_status_t *v1_custom_resource_definition_status_par v1_custom_resource_definition_names_free(accepted_names_local_nonprim); accepted_names_local_nonprim = NULL; } + if (conditionsList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, conditionsList) { + v1_custom_resource_definition_condition_free(listEntry->data); + listEntry->data = NULL; + } + list_freeList(conditionsList); + conditionsList = NULL; + } + if (stored_versionsList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, stored_versionsList) { + free(listEntry->data); + listEntry->data = NULL; + } + list_freeList(stored_versionsList); + stored_versionsList = NULL; + } return NULL; } diff --git a/kubernetes/model/v1_custom_resource_definition_version.c b/kubernetes/model/v1_custom_resource_definition_version.c index 67994bc5..17130944 100644 --- a/kubernetes/model/v1_custom_resource_definition_version.c +++ b/kubernetes/model/v1_custom_resource_definition_version.c @@ -169,6 +169,9 @@ v1_custom_resource_definition_version_t *v1_custom_resource_definition_version_p v1_custom_resource_definition_version_t *v1_custom_resource_definition_version_local_var = NULL; + // define the local list for v1_custom_resource_definition_version->additional_printer_columns + list_t *additional_printer_columnsList = NULL; + // define the local variable for v1_custom_resource_definition_version->schema v1_custom_resource_validation_t *schema_local_nonprim = NULL; @@ -177,9 +180,8 @@ v1_custom_resource_definition_version_t *v1_custom_resource_definition_version_p // v1_custom_resource_definition_version->additional_printer_columns cJSON *additional_printer_columns = cJSON_GetObjectItemCaseSensitive(v1_custom_resource_definition_versionJSON, "additionalPrinterColumns"); - list_t *additional_printer_columnsList; if (additional_printer_columns) { - cJSON *additional_printer_columns_local_nonprimitive; + cJSON *additional_printer_columns_local_nonprimitive = NULL; if(!cJSON_IsArray(additional_printer_columns)){ goto end; //nonprimitive container } @@ -277,6 +279,15 @@ v1_custom_resource_definition_version_t *v1_custom_resource_definition_version_p return v1_custom_resource_definition_version_local_var; end: + if (additional_printer_columnsList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, additional_printer_columnsList) { + v1_custom_resource_column_definition_free(listEntry->data); + listEntry->data = NULL; + } + list_freeList(additional_printer_columnsList); + additional_printer_columnsList = NULL; + } if (schema_local_nonprim) { v1_custom_resource_validation_free(schema_local_nonprim); schema_local_nonprim = NULL; diff --git a/kubernetes/model/v1_daemon_set_list.c b/kubernetes/model/v1_daemon_set_list.c index 14fe883b..fb21223a 100644 --- a/kubernetes/model/v1_daemon_set_list.c +++ b/kubernetes/model/v1_daemon_set_list.c @@ -116,6 +116,9 @@ v1_daemon_set_list_t *v1_daemon_set_list_parseFromJSON(cJSON *v1_daemon_set_list v1_daemon_set_list_t *v1_daemon_set_list_local_var = NULL; + // define the local list for v1_daemon_set_list->items + list_t *itemsList = NULL; + // define the local variable for v1_daemon_set_list->metadata v1_list_meta_t *metadata_local_nonprim = NULL; @@ -134,9 +137,8 @@ v1_daemon_set_list_t *v1_daemon_set_list_parseFromJSON(cJSON *v1_daemon_set_list goto end; } - list_t *itemsList; - cJSON *items_local_nonprimitive; + cJSON *items_local_nonprimitive = NULL; if(!cJSON_IsArray(items)){ goto end; //nonprimitive container } @@ -178,6 +180,15 @@ v1_daemon_set_list_t *v1_daemon_set_list_parseFromJSON(cJSON *v1_daemon_set_list return v1_daemon_set_list_local_var; end: + if (itemsList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, itemsList) { + v1_daemon_set_free(listEntry->data); + listEntry->data = NULL; + } + list_freeList(itemsList); + itemsList = NULL; + } if (metadata_local_nonprim) { v1_list_meta_free(metadata_local_nonprim); metadata_local_nonprim = NULL; diff --git a/kubernetes/model/v1_daemon_set_status.c b/kubernetes/model/v1_daemon_set_status.c index 6222ee50..1cacf194 100644 --- a/kubernetes/model/v1_daemon_set_status.c +++ b/kubernetes/model/v1_daemon_set_status.c @@ -165,6 +165,9 @@ v1_daemon_set_status_t *v1_daemon_set_status_parseFromJSON(cJSON *v1_daemon_set_ v1_daemon_set_status_t *v1_daemon_set_status_local_var = NULL; + // define the local list for v1_daemon_set_status->conditions + list_t *conditionsList = NULL; + // v1_daemon_set_status->collision_count cJSON *collision_count = cJSON_GetObjectItemCaseSensitive(v1_daemon_set_statusJSON, "collisionCount"); if (collision_count) { @@ -176,9 +179,8 @@ v1_daemon_set_status_t *v1_daemon_set_status_parseFromJSON(cJSON *v1_daemon_set_ // v1_daemon_set_status->conditions cJSON *conditions = cJSON_GetObjectItemCaseSensitive(v1_daemon_set_statusJSON, "conditions"); - list_t *conditionsList; if (conditions) { - cJSON *conditions_local_nonprimitive; + cJSON *conditions_local_nonprimitive = NULL; if(!cJSON_IsArray(conditions)){ goto end; //nonprimitive container } @@ -296,6 +298,15 @@ v1_daemon_set_status_t *v1_daemon_set_status_parseFromJSON(cJSON *v1_daemon_set_ return v1_daemon_set_status_local_var; end: + if (conditionsList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, conditionsList) { + v1_daemon_set_condition_free(listEntry->data); + listEntry->data = NULL; + } + list_freeList(conditionsList); + conditionsList = NULL; + } return NULL; } diff --git a/kubernetes/model/v1_delete_options.c b/kubernetes/model/v1_delete_options.c index 56c53a81..900e88bc 100644 --- a/kubernetes/model/v1_delete_options.c +++ b/kubernetes/model/v1_delete_options.c @@ -145,6 +145,9 @@ v1_delete_options_t *v1_delete_options_parseFromJSON(cJSON *v1_delete_optionsJSO v1_delete_options_t *v1_delete_options_local_var = NULL; + // define the local list for v1_delete_options->dry_run + list_t *dry_runList = NULL; + // define the local variable for v1_delete_options->preconditions v1_preconditions_t *preconditions_local_nonprim = NULL; @@ -159,9 +162,8 @@ v1_delete_options_t *v1_delete_options_parseFromJSON(cJSON *v1_delete_optionsJSO // v1_delete_options->dry_run cJSON *dry_run = cJSON_GetObjectItemCaseSensitive(v1_delete_optionsJSON, "dryRun"); - list_t *dry_runList; if (dry_run) { - cJSON *dry_run_local; + cJSON *dry_run_local = NULL; if(!cJSON_IsArray(dry_run)) { goto end;//primitive container } @@ -232,6 +234,15 @@ v1_delete_options_t *v1_delete_options_parseFromJSON(cJSON *v1_delete_optionsJSO return v1_delete_options_local_var; end: + if (dry_runList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, dry_runList) { + free(listEntry->data); + listEntry->data = NULL; + } + list_freeList(dry_runList); + dry_runList = NULL; + } if (preconditions_local_nonprim) { v1_preconditions_free(preconditions_local_nonprim); preconditions_local_nonprim = NULL; diff --git a/kubernetes/model/v1_deployment_list.c b/kubernetes/model/v1_deployment_list.c index 3a5a06a7..4a29784b 100644 --- a/kubernetes/model/v1_deployment_list.c +++ b/kubernetes/model/v1_deployment_list.c @@ -116,6 +116,9 @@ v1_deployment_list_t *v1_deployment_list_parseFromJSON(cJSON *v1_deployment_list v1_deployment_list_t *v1_deployment_list_local_var = NULL; + // define the local list for v1_deployment_list->items + list_t *itemsList = NULL; + // define the local variable for v1_deployment_list->metadata v1_list_meta_t *metadata_local_nonprim = NULL; @@ -134,9 +137,8 @@ v1_deployment_list_t *v1_deployment_list_parseFromJSON(cJSON *v1_deployment_list goto end; } - list_t *itemsList; - cJSON *items_local_nonprimitive; + cJSON *items_local_nonprimitive = NULL; if(!cJSON_IsArray(items)){ goto end; //nonprimitive container } @@ -178,6 +180,15 @@ v1_deployment_list_t *v1_deployment_list_parseFromJSON(cJSON *v1_deployment_list return v1_deployment_list_local_var; end: + if (itemsList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, itemsList) { + v1_deployment_free(listEntry->data); + listEntry->data = NULL; + } + list_freeList(itemsList); + itemsList = NULL; + } if (metadata_local_nonprim) { v1_list_meta_free(metadata_local_nonprim); metadata_local_nonprim = NULL; diff --git a/kubernetes/model/v1_deployment_status.c b/kubernetes/model/v1_deployment_status.c index 6c9b2fb2..b2456454 100644 --- a/kubernetes/model/v1_deployment_status.c +++ b/kubernetes/model/v1_deployment_status.c @@ -137,6 +137,9 @@ v1_deployment_status_t *v1_deployment_status_parseFromJSON(cJSON *v1_deployment_ v1_deployment_status_t *v1_deployment_status_local_var = NULL; + // define the local list for v1_deployment_status->conditions + list_t *conditionsList = NULL; + // v1_deployment_status->available_replicas cJSON *available_replicas = cJSON_GetObjectItemCaseSensitive(v1_deployment_statusJSON, "availableReplicas"); if (available_replicas) { @@ -157,9 +160,8 @@ v1_deployment_status_t *v1_deployment_status_parseFromJSON(cJSON *v1_deployment_ // v1_deployment_status->conditions cJSON *conditions = cJSON_GetObjectItemCaseSensitive(v1_deployment_statusJSON, "conditions"); - list_t *conditionsList; if (conditions) { - cJSON *conditions_local_nonprimitive; + cJSON *conditions_local_nonprimitive = NULL; if(!cJSON_IsArray(conditions)){ goto end; //nonprimitive container } @@ -236,6 +238,15 @@ v1_deployment_status_t *v1_deployment_status_parseFromJSON(cJSON *v1_deployment_ return v1_deployment_status_local_var; end: + if (conditionsList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, conditionsList) { + v1_deployment_condition_free(listEntry->data); + listEntry->data = NULL; + } + list_freeList(conditionsList); + conditionsList = NULL; + } return NULL; } diff --git a/kubernetes/model/v1_downward_api_projection.c b/kubernetes/model/v1_downward_api_projection.c index 7e06b7c5..85e779e9 100644 --- a/kubernetes/model/v1_downward_api_projection.c +++ b/kubernetes/model/v1_downward_api_projection.c @@ -67,11 +67,13 @@ v1_downward_api_projection_t *v1_downward_api_projection_parseFromJSON(cJSON *v1 v1_downward_api_projection_t *v1_downward_api_projection_local_var = NULL; + // define the local list for v1_downward_api_projection->items + list_t *itemsList = NULL; + // v1_downward_api_projection->items cJSON *items = cJSON_GetObjectItemCaseSensitive(v1_downward_api_projectionJSON, "items"); - list_t *itemsList; if (items) { - cJSON *items_local_nonprimitive; + cJSON *items_local_nonprimitive = NULL; if(!cJSON_IsArray(items)){ goto end; //nonprimitive container } @@ -96,6 +98,15 @@ v1_downward_api_projection_t *v1_downward_api_projection_parseFromJSON(cJSON *v1 return v1_downward_api_projection_local_var; end: + if (itemsList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, itemsList) { + v1_downward_api_volume_file_free(listEntry->data); + listEntry->data = NULL; + } + list_freeList(itemsList); + itemsList = NULL; + } return NULL; } diff --git a/kubernetes/model/v1_downward_api_volume_source.c b/kubernetes/model/v1_downward_api_volume_source.c index bc7d39ff..93231c0b 100644 --- a/kubernetes/model/v1_downward_api_volume_source.c +++ b/kubernetes/model/v1_downward_api_volume_source.c @@ -77,6 +77,9 @@ v1_downward_api_volume_source_t *v1_downward_api_volume_source_parseFromJSON(cJS v1_downward_api_volume_source_t *v1_downward_api_volume_source_local_var = NULL; + // define the local list for v1_downward_api_volume_source->items + list_t *itemsList = NULL; + // v1_downward_api_volume_source->default_mode cJSON *default_mode = cJSON_GetObjectItemCaseSensitive(v1_downward_api_volume_sourceJSON, "defaultMode"); if (default_mode) { @@ -88,9 +91,8 @@ v1_downward_api_volume_source_t *v1_downward_api_volume_source_parseFromJSON(cJS // v1_downward_api_volume_source->items cJSON *items = cJSON_GetObjectItemCaseSensitive(v1_downward_api_volume_sourceJSON, "items"); - list_t *itemsList; if (items) { - cJSON *items_local_nonprimitive; + cJSON *items_local_nonprimitive = NULL; if(!cJSON_IsArray(items)){ goto end; //nonprimitive container } @@ -116,6 +118,15 @@ v1_downward_api_volume_source_t *v1_downward_api_volume_source_parseFromJSON(cJS return v1_downward_api_volume_source_local_var; end: + if (itemsList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, itemsList) { + v1_downward_api_volume_file_free(listEntry->data); + listEntry->data = NULL; + } + list_freeList(itemsList); + itemsList = NULL; + } return NULL; } diff --git a/kubernetes/model/v1_endpoint.c b/kubernetes/model/v1_endpoint.c index 41aa89a3..9ebf4bdb 100644 --- a/kubernetes/model/v1_endpoint.c +++ b/kubernetes/model/v1_endpoint.c @@ -197,9 +197,15 @@ v1_endpoint_t *v1_endpoint_parseFromJSON(cJSON *v1_endpointJSON){ v1_endpoint_t *v1_endpoint_local_var = NULL; + // define the local list for v1_endpoint->addresses + list_t *addressesList = NULL; + // define the local variable for v1_endpoint->conditions v1_endpoint_conditions_t *conditions_local_nonprim = NULL; + // define the local map for v1_endpoint->deprecated_topology + list_t *deprecated_topologyList = NULL; + // define the local variable for v1_endpoint->hints v1_endpoint_hints_t *hints_local_nonprim = NULL; @@ -212,9 +218,8 @@ v1_endpoint_t *v1_endpoint_parseFromJSON(cJSON *v1_endpointJSON){ goto end; } - list_t *addressesList; - cJSON *addresses_local; + cJSON *addresses_local = NULL; if(!cJSON_IsArray(addresses)) { goto end;//primitive container } @@ -237,9 +242,8 @@ v1_endpoint_t *v1_endpoint_parseFromJSON(cJSON *v1_endpointJSON){ // v1_endpoint->deprecated_topology cJSON *deprecated_topology = cJSON_GetObjectItemCaseSensitive(v1_endpointJSON, "deprecatedTopology"); - list_t *deprecated_topologyList; if (deprecated_topology) { - cJSON *deprecated_topology_local_map; + cJSON *deprecated_topology_local_map = NULL; if(!cJSON_IsObject(deprecated_topology)) { goto end;//primitive map container } @@ -310,10 +314,33 @@ v1_endpoint_t *v1_endpoint_parseFromJSON(cJSON *v1_endpointJSON){ return v1_endpoint_local_var; end: + if (addressesList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, addressesList) { + free(listEntry->data); + listEntry->data = NULL; + } + list_freeList(addressesList); + addressesList = NULL; + } if (conditions_local_nonprim) { v1_endpoint_conditions_free(conditions_local_nonprim); conditions_local_nonprim = NULL; } + if (deprecated_topologyList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, deprecated_topologyList) { + keyValuePair_t *localKeyValue = (keyValuePair_t*) listEntry->data; + free(localKeyValue->key); + localKeyValue->key = NULL; + free(localKeyValue->value); + localKeyValue->value = NULL; + keyValuePair_free(localKeyValue); + localKeyValue = NULL; + } + list_freeList(deprecated_topologyList); + deprecated_topologyList = NULL; + } if (hints_local_nonprim) { v1_endpoint_hints_free(hints_local_nonprim); hints_local_nonprim = NULL; diff --git a/kubernetes/model/v1_endpoint_hints.c b/kubernetes/model/v1_endpoint_hints.c index ff1d8842..fef90480 100644 --- a/kubernetes/model/v1_endpoint_hints.c +++ b/kubernetes/model/v1_endpoint_hints.c @@ -67,11 +67,13 @@ v1_endpoint_hints_t *v1_endpoint_hints_parseFromJSON(cJSON *v1_endpoint_hintsJSO v1_endpoint_hints_t *v1_endpoint_hints_local_var = NULL; + // define the local list for v1_endpoint_hints->for_zones + list_t *for_zonesList = NULL; + // v1_endpoint_hints->for_zones cJSON *for_zones = cJSON_GetObjectItemCaseSensitive(v1_endpoint_hintsJSON, "forZones"); - list_t *for_zonesList; if (for_zones) { - cJSON *for_zones_local_nonprimitive; + cJSON *for_zones_local_nonprimitive = NULL; if(!cJSON_IsArray(for_zones)){ goto end; //nonprimitive container } @@ -96,6 +98,15 @@ v1_endpoint_hints_t *v1_endpoint_hints_parseFromJSON(cJSON *v1_endpoint_hintsJSO return v1_endpoint_hints_local_var; end: + if (for_zonesList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, for_zonesList) { + v1_for_zone_free(listEntry->data); + listEntry->data = NULL; + } + list_freeList(for_zonesList); + for_zonesList = NULL; + } return NULL; } diff --git a/kubernetes/model/v1_endpoint_slice.c b/kubernetes/model/v1_endpoint_slice.c index e40f6fdb..e8060226 100644 --- a/kubernetes/model/v1_endpoint_slice.c +++ b/kubernetes/model/v1_endpoint_slice.c @@ -161,9 +161,15 @@ v1_endpoint_slice_t *v1_endpoint_slice_parseFromJSON(cJSON *v1_endpoint_sliceJSO v1_endpoint_slice_t *v1_endpoint_slice_local_var = NULL; + // define the local list for v1_endpoint_slice->endpoints + list_t *endpointsList = NULL; + // define the local variable for v1_endpoint_slice->metadata v1_object_meta_t *metadata_local_nonprim = NULL; + // define the local list for v1_endpoint_slice->ports + list_t *portsList = NULL; + // v1_endpoint_slice->address_type cJSON *address_type = cJSON_GetObjectItemCaseSensitive(v1_endpoint_sliceJSON, "addressType"); if (!address_type) { @@ -191,9 +197,8 @@ v1_endpoint_slice_t *v1_endpoint_slice_parseFromJSON(cJSON *v1_endpoint_sliceJSO goto end; } - list_t *endpointsList; - cJSON *endpoints_local_nonprimitive; + cJSON *endpoints_local_nonprimitive = NULL; if(!cJSON_IsArray(endpoints)){ goto end; //nonprimitive container } @@ -227,9 +232,8 @@ v1_endpoint_slice_t *v1_endpoint_slice_parseFromJSON(cJSON *v1_endpoint_sliceJSO // v1_endpoint_slice->ports cJSON *ports = cJSON_GetObjectItemCaseSensitive(v1_endpoint_sliceJSON, "ports"); - list_t *portsList; if (ports) { - cJSON *ports_local_nonprimitive; + cJSON *ports_local_nonprimitive = NULL; if(!cJSON_IsArray(ports)){ goto end; //nonprimitive container } @@ -259,10 +263,28 @@ v1_endpoint_slice_t *v1_endpoint_slice_parseFromJSON(cJSON *v1_endpoint_sliceJSO return v1_endpoint_slice_local_var; end: + if (endpointsList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, endpointsList) { + v1_endpoint_free(listEntry->data); + listEntry->data = NULL; + } + list_freeList(endpointsList); + endpointsList = NULL; + } if (metadata_local_nonprim) { v1_object_meta_free(metadata_local_nonprim); metadata_local_nonprim = NULL; } + if (portsList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, portsList) { + discovery_v1_endpoint_port_free(listEntry->data); + listEntry->data = NULL; + } + list_freeList(portsList); + portsList = NULL; + } return NULL; } diff --git a/kubernetes/model/v1_endpoint_slice_list.c b/kubernetes/model/v1_endpoint_slice_list.c index 87047209..fe51bb80 100644 --- a/kubernetes/model/v1_endpoint_slice_list.c +++ b/kubernetes/model/v1_endpoint_slice_list.c @@ -116,6 +116,9 @@ v1_endpoint_slice_list_t *v1_endpoint_slice_list_parseFromJSON(cJSON *v1_endpoin v1_endpoint_slice_list_t *v1_endpoint_slice_list_local_var = NULL; + // define the local list for v1_endpoint_slice_list->items + list_t *itemsList = NULL; + // define the local variable for v1_endpoint_slice_list->metadata v1_list_meta_t *metadata_local_nonprim = NULL; @@ -134,9 +137,8 @@ v1_endpoint_slice_list_t *v1_endpoint_slice_list_parseFromJSON(cJSON *v1_endpoin goto end; } - list_t *itemsList; - cJSON *items_local_nonprimitive; + cJSON *items_local_nonprimitive = NULL; if(!cJSON_IsArray(items)){ goto end; //nonprimitive container } @@ -178,6 +180,15 @@ v1_endpoint_slice_list_t *v1_endpoint_slice_list_parseFromJSON(cJSON *v1_endpoin return v1_endpoint_slice_list_local_var; end: + if (itemsList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, itemsList) { + v1_endpoint_slice_free(listEntry->data); + listEntry->data = NULL; + } + list_freeList(itemsList); + itemsList = NULL; + } if (metadata_local_nonprim) { v1_list_meta_free(metadata_local_nonprim); metadata_local_nonprim = NULL; diff --git a/kubernetes/model/v1_endpoint_subset.c b/kubernetes/model/v1_endpoint_subset.c index 23720ae6..1c2fcabc 100644 --- a/kubernetes/model/v1_endpoint_subset.c +++ b/kubernetes/model/v1_endpoint_subset.c @@ -125,11 +125,19 @@ v1_endpoint_subset_t *v1_endpoint_subset_parseFromJSON(cJSON *v1_endpoint_subset v1_endpoint_subset_t *v1_endpoint_subset_local_var = NULL; + // define the local list for v1_endpoint_subset->addresses + list_t *addressesList = NULL; + + // define the local list for v1_endpoint_subset->not_ready_addresses + list_t *not_ready_addressesList = NULL; + + // define the local list for v1_endpoint_subset->ports + list_t *portsList = NULL; + // v1_endpoint_subset->addresses cJSON *addresses = cJSON_GetObjectItemCaseSensitive(v1_endpoint_subsetJSON, "addresses"); - list_t *addressesList; if (addresses) { - cJSON *addresses_local_nonprimitive; + cJSON *addresses_local_nonprimitive = NULL; if(!cJSON_IsArray(addresses)){ goto end; //nonprimitive container } @@ -149,9 +157,8 @@ v1_endpoint_subset_t *v1_endpoint_subset_parseFromJSON(cJSON *v1_endpoint_subset // v1_endpoint_subset->not_ready_addresses cJSON *not_ready_addresses = cJSON_GetObjectItemCaseSensitive(v1_endpoint_subsetJSON, "notReadyAddresses"); - list_t *not_ready_addressesList; if (not_ready_addresses) { - cJSON *not_ready_addresses_local_nonprimitive; + cJSON *not_ready_addresses_local_nonprimitive = NULL; if(!cJSON_IsArray(not_ready_addresses)){ goto end; //nonprimitive container } @@ -171,9 +178,8 @@ v1_endpoint_subset_t *v1_endpoint_subset_parseFromJSON(cJSON *v1_endpoint_subset // v1_endpoint_subset->ports cJSON *ports = cJSON_GetObjectItemCaseSensitive(v1_endpoint_subsetJSON, "ports"); - list_t *portsList; if (ports) { - cJSON *ports_local_nonprimitive; + cJSON *ports_local_nonprimitive = NULL; if(!cJSON_IsArray(ports)){ goto end; //nonprimitive container } @@ -200,6 +206,33 @@ v1_endpoint_subset_t *v1_endpoint_subset_parseFromJSON(cJSON *v1_endpoint_subset return v1_endpoint_subset_local_var; end: + if (addressesList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, addressesList) { + v1_endpoint_address_free(listEntry->data); + listEntry->data = NULL; + } + list_freeList(addressesList); + addressesList = NULL; + } + if (not_ready_addressesList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, not_ready_addressesList) { + v1_endpoint_address_free(listEntry->data); + listEntry->data = NULL; + } + list_freeList(not_ready_addressesList); + not_ready_addressesList = NULL; + } + if (portsList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, portsList) { + core_v1_endpoint_port_free(listEntry->data); + listEntry->data = NULL; + } + list_freeList(portsList); + portsList = NULL; + } return NULL; } diff --git a/kubernetes/model/v1_endpoints.c b/kubernetes/model/v1_endpoints.c index aaafbffa..c3c2a3c6 100644 --- a/kubernetes/model/v1_endpoints.c +++ b/kubernetes/model/v1_endpoints.c @@ -117,6 +117,9 @@ v1_endpoints_t *v1_endpoints_parseFromJSON(cJSON *v1_endpointsJSON){ // define the local variable for v1_endpoints->metadata v1_object_meta_t *metadata_local_nonprim = NULL; + // define the local list for v1_endpoints->subsets + list_t *subsetsList = NULL; + // v1_endpoints->api_version cJSON *api_version = cJSON_GetObjectItemCaseSensitive(v1_endpointsJSON, "apiVersion"); if (api_version) { @@ -143,9 +146,8 @@ v1_endpoints_t *v1_endpoints_parseFromJSON(cJSON *v1_endpointsJSON){ // v1_endpoints->subsets cJSON *subsets = cJSON_GetObjectItemCaseSensitive(v1_endpointsJSON, "subsets"); - list_t *subsetsList; if (subsets) { - cJSON *subsets_local_nonprimitive; + cJSON *subsets_local_nonprimitive = NULL; if(!cJSON_IsArray(subsets)){ goto end; //nonprimitive container } @@ -177,6 +179,15 @@ v1_endpoints_t *v1_endpoints_parseFromJSON(cJSON *v1_endpointsJSON){ v1_object_meta_free(metadata_local_nonprim); metadata_local_nonprim = NULL; } + if (subsetsList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, subsetsList) { + v1_endpoint_subset_free(listEntry->data); + listEntry->data = NULL; + } + list_freeList(subsetsList); + subsetsList = NULL; + } return NULL; } diff --git a/kubernetes/model/v1_endpoints_list.c b/kubernetes/model/v1_endpoints_list.c index febd9252..cd853d80 100644 --- a/kubernetes/model/v1_endpoints_list.c +++ b/kubernetes/model/v1_endpoints_list.c @@ -116,6 +116,9 @@ v1_endpoints_list_t *v1_endpoints_list_parseFromJSON(cJSON *v1_endpoints_listJSO v1_endpoints_list_t *v1_endpoints_list_local_var = NULL; + // define the local list for v1_endpoints_list->items + list_t *itemsList = NULL; + // define the local variable for v1_endpoints_list->metadata v1_list_meta_t *metadata_local_nonprim = NULL; @@ -134,9 +137,8 @@ v1_endpoints_list_t *v1_endpoints_list_parseFromJSON(cJSON *v1_endpoints_listJSO goto end; } - list_t *itemsList; - cJSON *items_local_nonprimitive; + cJSON *items_local_nonprimitive = NULL; if(!cJSON_IsArray(items)){ goto end; //nonprimitive container } @@ -178,6 +180,15 @@ v1_endpoints_list_t *v1_endpoints_list_parseFromJSON(cJSON *v1_endpoints_listJSO return v1_endpoints_list_local_var; end: + if (itemsList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, itemsList) { + v1_endpoints_free(listEntry->data); + listEntry->data = NULL; + } + list_freeList(itemsList); + itemsList = NULL; + } if (metadata_local_nonprim) { v1_list_meta_free(metadata_local_nonprim); metadata_local_nonprim = NULL; diff --git a/kubernetes/model/v1_ephemeral_container.c b/kubernetes/model/v1_ephemeral_container.c index 3398b237..e6b2cca2 100644 --- a/kubernetes/model/v1_ephemeral_container.c +++ b/kubernetes/model/v1_ephemeral_container.c @@ -479,12 +479,27 @@ v1_ephemeral_container_t *v1_ephemeral_container_parseFromJSON(cJSON *v1_ephemer v1_ephemeral_container_t *v1_ephemeral_container_local_var = NULL; + // define the local list for v1_ephemeral_container->args + list_t *argsList = NULL; + + // define the local list for v1_ephemeral_container->command + list_t *commandList = NULL; + + // define the local list for v1_ephemeral_container->env + list_t *envList = NULL; + + // define the local list for v1_ephemeral_container->env_from + list_t *env_fromList = NULL; + // define the local variable for v1_ephemeral_container->lifecycle v1_lifecycle_t *lifecycle_local_nonprim = NULL; // define the local variable for v1_ephemeral_container->liveness_probe v1_probe_t *liveness_probe_local_nonprim = NULL; + // define the local list for v1_ephemeral_container->ports + list_t *portsList = NULL; + // define the local variable for v1_ephemeral_container->readiness_probe v1_probe_t *readiness_probe_local_nonprim = NULL; @@ -497,11 +512,16 @@ v1_ephemeral_container_t *v1_ephemeral_container_parseFromJSON(cJSON *v1_ephemer // define the local variable for v1_ephemeral_container->startup_probe v1_probe_t *startup_probe_local_nonprim = NULL; + // define the local list for v1_ephemeral_container->volume_devices + list_t *volume_devicesList = NULL; + + // define the local list for v1_ephemeral_container->volume_mounts + list_t *volume_mountsList = NULL; + // v1_ephemeral_container->args cJSON *args = cJSON_GetObjectItemCaseSensitive(v1_ephemeral_containerJSON, "args"); - list_t *argsList; if (args) { - cJSON *args_local; + cJSON *args_local = NULL; if(!cJSON_IsArray(args)) { goto end;//primitive container } @@ -519,9 +539,8 @@ v1_ephemeral_container_t *v1_ephemeral_container_parseFromJSON(cJSON *v1_ephemer // v1_ephemeral_container->command cJSON *command = cJSON_GetObjectItemCaseSensitive(v1_ephemeral_containerJSON, "command"); - list_t *commandList; if (command) { - cJSON *command_local; + cJSON *command_local = NULL; if(!cJSON_IsArray(command)) { goto end;//primitive container } @@ -539,9 +558,8 @@ v1_ephemeral_container_t *v1_ephemeral_container_parseFromJSON(cJSON *v1_ephemer // v1_ephemeral_container->env cJSON *env = cJSON_GetObjectItemCaseSensitive(v1_ephemeral_containerJSON, "env"); - list_t *envList; if (env) { - cJSON *env_local_nonprimitive; + cJSON *env_local_nonprimitive = NULL; if(!cJSON_IsArray(env)){ goto end; //nonprimitive container } @@ -561,9 +579,8 @@ v1_ephemeral_container_t *v1_ephemeral_container_parseFromJSON(cJSON *v1_ephemer // v1_ephemeral_container->env_from cJSON *env_from = cJSON_GetObjectItemCaseSensitive(v1_ephemeral_containerJSON, "envFrom"); - list_t *env_fromList; if (env_from) { - cJSON *env_from_local_nonprimitive; + cJSON *env_from_local_nonprimitive = NULL; if(!cJSON_IsArray(env_from)){ goto end; //nonprimitive container } @@ -625,9 +642,8 @@ v1_ephemeral_container_t *v1_ephemeral_container_parseFromJSON(cJSON *v1_ephemer // v1_ephemeral_container->ports cJSON *ports = cJSON_GetObjectItemCaseSensitive(v1_ephemeral_containerJSON, "ports"); - list_t *portsList; if (ports) { - cJSON *ports_local_nonprimitive; + cJSON *ports_local_nonprimitive = NULL; if(!cJSON_IsArray(ports)){ goto end; //nonprimitive container } @@ -725,9 +741,8 @@ v1_ephemeral_container_t *v1_ephemeral_container_parseFromJSON(cJSON *v1_ephemer // v1_ephemeral_container->volume_devices cJSON *volume_devices = cJSON_GetObjectItemCaseSensitive(v1_ephemeral_containerJSON, "volumeDevices"); - list_t *volume_devicesList; if (volume_devices) { - cJSON *volume_devices_local_nonprimitive; + cJSON *volume_devices_local_nonprimitive = NULL; if(!cJSON_IsArray(volume_devices)){ goto end; //nonprimitive container } @@ -747,9 +762,8 @@ v1_ephemeral_container_t *v1_ephemeral_container_parseFromJSON(cJSON *v1_ephemer // v1_ephemeral_container->volume_mounts cJSON *volume_mounts = cJSON_GetObjectItemCaseSensitive(v1_ephemeral_containerJSON, "volumeMounts"); - list_t *volume_mountsList; if (volume_mounts) { - cJSON *volume_mounts_local_nonprimitive; + cJSON *volume_mounts_local_nonprimitive = NULL; if(!cJSON_IsArray(volume_mounts)){ goto end; //nonprimitive container } @@ -805,6 +819,42 @@ v1_ephemeral_container_t *v1_ephemeral_container_parseFromJSON(cJSON *v1_ephemer return v1_ephemeral_container_local_var; end: + if (argsList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, argsList) { + free(listEntry->data); + listEntry->data = NULL; + } + list_freeList(argsList); + argsList = NULL; + } + if (commandList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, commandList) { + free(listEntry->data); + listEntry->data = NULL; + } + list_freeList(commandList); + commandList = NULL; + } + if (envList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, envList) { + v1_env_var_free(listEntry->data); + listEntry->data = NULL; + } + list_freeList(envList); + envList = NULL; + } + if (env_fromList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, env_fromList) { + v1_env_from_source_free(listEntry->data); + listEntry->data = NULL; + } + list_freeList(env_fromList); + env_fromList = NULL; + } if (lifecycle_local_nonprim) { v1_lifecycle_free(lifecycle_local_nonprim); lifecycle_local_nonprim = NULL; @@ -813,6 +863,15 @@ v1_ephemeral_container_t *v1_ephemeral_container_parseFromJSON(cJSON *v1_ephemer v1_probe_free(liveness_probe_local_nonprim); liveness_probe_local_nonprim = NULL; } + if (portsList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, portsList) { + v1_container_port_free(listEntry->data); + listEntry->data = NULL; + } + list_freeList(portsList); + portsList = NULL; + } if (readiness_probe_local_nonprim) { v1_probe_free(readiness_probe_local_nonprim); readiness_probe_local_nonprim = NULL; @@ -829,6 +888,24 @@ v1_ephemeral_container_t *v1_ephemeral_container_parseFromJSON(cJSON *v1_ephemer v1_probe_free(startup_probe_local_nonprim); startup_probe_local_nonprim = NULL; } + if (volume_devicesList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, volume_devicesList) { + v1_volume_device_free(listEntry->data); + listEntry->data = NULL; + } + list_freeList(volume_devicesList); + volume_devicesList = NULL; + } + if (volume_mountsList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, volume_mountsList) { + v1_volume_mount_free(listEntry->data); + listEntry->data = NULL; + } + list_freeList(volume_mountsList); + volume_mountsList = NULL; + } return NULL; } diff --git a/kubernetes/model/v1_exec_action.c b/kubernetes/model/v1_exec_action.c index 7f729e43..f60af541 100644 --- a/kubernetes/model/v1_exec_action.c +++ b/kubernetes/model/v1_exec_action.c @@ -64,11 +64,13 @@ v1_exec_action_t *v1_exec_action_parseFromJSON(cJSON *v1_exec_actionJSON){ v1_exec_action_t *v1_exec_action_local_var = NULL; + // define the local list for v1_exec_action->command + list_t *commandList = NULL; + // v1_exec_action->command cJSON *command = cJSON_GetObjectItemCaseSensitive(v1_exec_actionJSON, "command"); - list_t *commandList; if (command) { - cJSON *command_local; + cJSON *command_local = NULL; if(!cJSON_IsArray(command)) { goto end;//primitive container } @@ -91,6 +93,15 @@ v1_exec_action_t *v1_exec_action_parseFromJSON(cJSON *v1_exec_actionJSON){ return v1_exec_action_local_var; end: + if (commandList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, commandList) { + free(listEntry->data); + listEntry->data = NULL; + } + list_freeList(commandList); + commandList = NULL; + } return NULL; } diff --git a/kubernetes/model/v1_fc_volume_source.c b/kubernetes/model/v1_fc_volume_source.c index 53ce0041..7b86a873 100644 --- a/kubernetes/model/v1_fc_volume_source.c +++ b/kubernetes/model/v1_fc_volume_source.c @@ -124,6 +124,12 @@ v1_fc_volume_source_t *v1_fc_volume_source_parseFromJSON(cJSON *v1_fc_volume_sou v1_fc_volume_source_t *v1_fc_volume_source_local_var = NULL; + // define the local list for v1_fc_volume_source->target_wwns + list_t *target_wwnsList = NULL; + + // define the local list for v1_fc_volume_source->wwids + list_t *wwidsList = NULL; + // v1_fc_volume_source->fs_type cJSON *fs_type = cJSON_GetObjectItemCaseSensitive(v1_fc_volume_sourceJSON, "fsType"); if (fs_type) { @@ -153,9 +159,8 @@ v1_fc_volume_source_t *v1_fc_volume_source_parseFromJSON(cJSON *v1_fc_volume_sou // v1_fc_volume_source->target_wwns cJSON *target_wwns = cJSON_GetObjectItemCaseSensitive(v1_fc_volume_sourceJSON, "targetWWNs"); - list_t *target_wwnsList; if (target_wwns) { - cJSON *target_wwns_local; + cJSON *target_wwns_local = NULL; if(!cJSON_IsArray(target_wwns)) { goto end;//primitive container } @@ -173,9 +178,8 @@ v1_fc_volume_source_t *v1_fc_volume_source_parseFromJSON(cJSON *v1_fc_volume_sou // v1_fc_volume_source->wwids cJSON *wwids = cJSON_GetObjectItemCaseSensitive(v1_fc_volume_sourceJSON, "wwids"); - list_t *wwidsList; if (wwids) { - cJSON *wwids_local; + cJSON *wwids_local = NULL; if(!cJSON_IsArray(wwids)) { goto end;//primitive container } @@ -202,6 +206,24 @@ v1_fc_volume_source_t *v1_fc_volume_source_parseFromJSON(cJSON *v1_fc_volume_sou return v1_fc_volume_source_local_var; end: + if (target_wwnsList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, target_wwnsList) { + free(listEntry->data); + listEntry->data = NULL; + } + list_freeList(target_wwnsList); + target_wwnsList = NULL; + } + if (wwidsList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, wwidsList) { + free(listEntry->data); + listEntry->data = NULL; + } + list_freeList(wwidsList); + wwidsList = NULL; + } return NULL; } diff --git a/kubernetes/model/v1_flex_persistent_volume_source.c b/kubernetes/model/v1_flex_persistent_volume_source.c index a76e5de5..2d7aa467 100644 --- a/kubernetes/model/v1_flex_persistent_volume_source.c +++ b/kubernetes/model/v1_flex_persistent_volume_source.c @@ -129,6 +129,9 @@ v1_flex_persistent_volume_source_t *v1_flex_persistent_volume_source_parseFromJS v1_flex_persistent_volume_source_t *v1_flex_persistent_volume_source_local_var = NULL; + // define the local map for v1_flex_persistent_volume_source->options + list_t *optionsList = NULL; + // define the local variable for v1_flex_persistent_volume_source->secret_ref v1_secret_reference_t *secret_ref_local_nonprim = NULL; @@ -155,9 +158,8 @@ v1_flex_persistent_volume_source_t *v1_flex_persistent_volume_source_parseFromJS // v1_flex_persistent_volume_source->options cJSON *options = cJSON_GetObjectItemCaseSensitive(v1_flex_persistent_volume_sourceJSON, "options"); - list_t *optionsList; if (options) { - cJSON *options_local_map; + cJSON *options_local_map = NULL; if(!cJSON_IsObject(options)) { goto end;//primitive map container } @@ -201,6 +203,20 @@ v1_flex_persistent_volume_source_t *v1_flex_persistent_volume_source_parseFromJS return v1_flex_persistent_volume_source_local_var; end: + if (optionsList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, optionsList) { + keyValuePair_t *localKeyValue = (keyValuePair_t*) listEntry->data; + free(localKeyValue->key); + localKeyValue->key = NULL; + free(localKeyValue->value); + localKeyValue->value = NULL; + keyValuePair_free(localKeyValue); + localKeyValue = NULL; + } + list_freeList(optionsList); + optionsList = NULL; + } if (secret_ref_local_nonprim) { v1_secret_reference_free(secret_ref_local_nonprim); secret_ref_local_nonprim = NULL; diff --git a/kubernetes/model/v1_flex_volume_source.c b/kubernetes/model/v1_flex_volume_source.c index 2d6807cc..58a89ef7 100644 --- a/kubernetes/model/v1_flex_volume_source.c +++ b/kubernetes/model/v1_flex_volume_source.c @@ -129,6 +129,9 @@ v1_flex_volume_source_t *v1_flex_volume_source_parseFromJSON(cJSON *v1_flex_volu v1_flex_volume_source_t *v1_flex_volume_source_local_var = NULL; + // define the local map for v1_flex_volume_source->options + list_t *optionsList = NULL; + // define the local variable for v1_flex_volume_source->secret_ref v1_local_object_reference_t *secret_ref_local_nonprim = NULL; @@ -155,9 +158,8 @@ v1_flex_volume_source_t *v1_flex_volume_source_parseFromJSON(cJSON *v1_flex_volu // v1_flex_volume_source->options cJSON *options = cJSON_GetObjectItemCaseSensitive(v1_flex_volume_sourceJSON, "options"); - list_t *optionsList; if (options) { - cJSON *options_local_map; + cJSON *options_local_map = NULL; if(!cJSON_IsObject(options)) { goto end;//primitive map container } @@ -201,6 +203,20 @@ v1_flex_volume_source_t *v1_flex_volume_source_parseFromJSON(cJSON *v1_flex_volu return v1_flex_volume_source_local_var; end: + if (optionsList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, optionsList) { + keyValuePair_t *localKeyValue = (keyValuePair_t*) listEntry->data; + free(localKeyValue->key); + localKeyValue->key = NULL; + free(localKeyValue->value); + localKeyValue->value = NULL; + keyValuePair_free(localKeyValue); + localKeyValue = NULL; + } + list_freeList(optionsList); + optionsList = NULL; + } if (secret_ref_local_nonprim) { v1_local_object_reference_free(secret_ref_local_nonprim); secret_ref_local_nonprim = NULL; diff --git a/kubernetes/model/v1_horizontal_pod_autoscaler_list.c b/kubernetes/model/v1_horizontal_pod_autoscaler_list.c index 56558d5a..3e59d056 100644 --- a/kubernetes/model/v1_horizontal_pod_autoscaler_list.c +++ b/kubernetes/model/v1_horizontal_pod_autoscaler_list.c @@ -116,6 +116,9 @@ v1_horizontal_pod_autoscaler_list_t *v1_horizontal_pod_autoscaler_list_parseFrom v1_horizontal_pod_autoscaler_list_t *v1_horizontal_pod_autoscaler_list_local_var = NULL; + // define the local list for v1_horizontal_pod_autoscaler_list->items + list_t *itemsList = NULL; + // define the local variable for v1_horizontal_pod_autoscaler_list->metadata v1_list_meta_t *metadata_local_nonprim = NULL; @@ -134,9 +137,8 @@ v1_horizontal_pod_autoscaler_list_t *v1_horizontal_pod_autoscaler_list_parseFrom goto end; } - list_t *itemsList; - cJSON *items_local_nonprimitive; + cJSON *items_local_nonprimitive = NULL; if(!cJSON_IsArray(items)){ goto end; //nonprimitive container } @@ -178,6 +180,15 @@ v1_horizontal_pod_autoscaler_list_t *v1_horizontal_pod_autoscaler_list_parseFrom return v1_horizontal_pod_autoscaler_list_local_var; end: + if (itemsList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, itemsList) { + v1_horizontal_pod_autoscaler_free(listEntry->data); + listEntry->data = NULL; + } + list_freeList(itemsList); + itemsList = NULL; + } if (metadata_local_nonprim) { v1_list_meta_free(metadata_local_nonprim); metadata_local_nonprim = NULL; diff --git a/kubernetes/model/v1_host_alias.c b/kubernetes/model/v1_host_alias.c index 1a02e0cf..a5644148 100644 --- a/kubernetes/model/v1_host_alias.c +++ b/kubernetes/model/v1_host_alias.c @@ -78,11 +78,13 @@ v1_host_alias_t *v1_host_alias_parseFromJSON(cJSON *v1_host_aliasJSON){ v1_host_alias_t *v1_host_alias_local_var = NULL; + // define the local list for v1_host_alias->hostnames + list_t *hostnamesList = NULL; + // v1_host_alias->hostnames cJSON *hostnames = cJSON_GetObjectItemCaseSensitive(v1_host_aliasJSON, "hostnames"); - list_t *hostnamesList; if (hostnames) { - cJSON *hostnames_local; + cJSON *hostnames_local = NULL; if(!cJSON_IsArray(hostnames)) { goto end;//primitive container } @@ -115,6 +117,15 @@ v1_host_alias_t *v1_host_alias_parseFromJSON(cJSON *v1_host_aliasJSON){ return v1_host_alias_local_var; end: + if (hostnamesList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, hostnamesList) { + free(listEntry->data); + listEntry->data = NULL; + } + list_freeList(hostnamesList); + hostnamesList = NULL; + } return NULL; } diff --git a/kubernetes/model/v1_http_get_action.c b/kubernetes/model/v1_http_get_action.c index 31924a25..96badd88 100644 --- a/kubernetes/model/v1_http_get_action.c +++ b/kubernetes/model/v1_http_get_action.c @@ -130,6 +130,9 @@ v1_http_get_action_t *v1_http_get_action_parseFromJSON(cJSON *v1_http_get_action v1_http_get_action_t *v1_http_get_action_local_var = NULL; + // define the local list for v1_http_get_action->http_headers + list_t *http_headersList = NULL; + // define the local variable for v1_http_get_action->port int_or_string_t *port_local_nonprim = NULL; @@ -144,9 +147,8 @@ v1_http_get_action_t *v1_http_get_action_parseFromJSON(cJSON *v1_http_get_action // v1_http_get_action->http_headers cJSON *http_headers = cJSON_GetObjectItemCaseSensitive(v1_http_get_actionJSON, "httpHeaders"); - list_t *http_headersList; if (http_headers) { - cJSON *http_headers_local_nonprimitive; + cJSON *http_headers_local_nonprimitive = NULL; if(!cJSON_IsArray(http_headers)){ goto end; //nonprimitive container } @@ -202,6 +204,15 @@ v1_http_get_action_t *v1_http_get_action_parseFromJSON(cJSON *v1_http_get_action return v1_http_get_action_local_var; end: + if (http_headersList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, http_headersList) { + v1_http_header_free(listEntry->data); + listEntry->data = NULL; + } + list_freeList(http_headersList); + http_headersList = NULL; + } if (port_local_nonprim) { int_or_string_free(port_local_nonprim); port_local_nonprim = NULL; diff --git a/kubernetes/model/v1_http_ingress_rule_value.c b/kubernetes/model/v1_http_ingress_rule_value.c index 25f9c73e..52d382ac 100644 --- a/kubernetes/model/v1_http_ingress_rule_value.c +++ b/kubernetes/model/v1_http_ingress_rule_value.c @@ -69,15 +69,17 @@ v1_http_ingress_rule_value_t *v1_http_ingress_rule_value_parseFromJSON(cJSON *v1 v1_http_ingress_rule_value_t *v1_http_ingress_rule_value_local_var = NULL; + // define the local list for v1_http_ingress_rule_value->paths + list_t *pathsList = NULL; + // v1_http_ingress_rule_value->paths cJSON *paths = cJSON_GetObjectItemCaseSensitive(v1_http_ingress_rule_valueJSON, "paths"); if (!paths) { goto end; } - list_t *pathsList; - cJSON *paths_local_nonprimitive; + cJSON *paths_local_nonprimitive = NULL; if(!cJSON_IsArray(paths)){ goto end; //nonprimitive container } @@ -101,6 +103,15 @@ v1_http_ingress_rule_value_t *v1_http_ingress_rule_value_parseFromJSON(cJSON *v1 return v1_http_ingress_rule_value_local_var; end: + if (pathsList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, pathsList) { + v1_http_ingress_path_free(listEntry->data); + listEntry->data = NULL; + } + list_freeList(pathsList); + pathsList = NULL; + } return NULL; } diff --git a/kubernetes/model/v1_ingress_class_list.c b/kubernetes/model/v1_ingress_class_list.c index b85046c3..dbbb75bd 100644 --- a/kubernetes/model/v1_ingress_class_list.c +++ b/kubernetes/model/v1_ingress_class_list.c @@ -116,6 +116,9 @@ v1_ingress_class_list_t *v1_ingress_class_list_parseFromJSON(cJSON *v1_ingress_c v1_ingress_class_list_t *v1_ingress_class_list_local_var = NULL; + // define the local list for v1_ingress_class_list->items + list_t *itemsList = NULL; + // define the local variable for v1_ingress_class_list->metadata v1_list_meta_t *metadata_local_nonprim = NULL; @@ -134,9 +137,8 @@ v1_ingress_class_list_t *v1_ingress_class_list_parseFromJSON(cJSON *v1_ingress_c goto end; } - list_t *itemsList; - cJSON *items_local_nonprimitive; + cJSON *items_local_nonprimitive = NULL; if(!cJSON_IsArray(items)){ goto end; //nonprimitive container } @@ -178,6 +180,15 @@ v1_ingress_class_list_t *v1_ingress_class_list_parseFromJSON(cJSON *v1_ingress_c return v1_ingress_class_list_local_var; end: + if (itemsList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, itemsList) { + v1_ingress_class_free(listEntry->data); + listEntry->data = NULL; + } + list_freeList(itemsList); + itemsList = NULL; + } if (metadata_local_nonprim) { v1_list_meta_free(metadata_local_nonprim); metadata_local_nonprim = NULL; diff --git a/kubernetes/model/v1_ingress_list.c b/kubernetes/model/v1_ingress_list.c index 8cc43885..cec19083 100644 --- a/kubernetes/model/v1_ingress_list.c +++ b/kubernetes/model/v1_ingress_list.c @@ -116,6 +116,9 @@ v1_ingress_list_t *v1_ingress_list_parseFromJSON(cJSON *v1_ingress_listJSON){ v1_ingress_list_t *v1_ingress_list_local_var = NULL; + // define the local list for v1_ingress_list->items + list_t *itemsList = NULL; + // define the local variable for v1_ingress_list->metadata v1_list_meta_t *metadata_local_nonprim = NULL; @@ -134,9 +137,8 @@ v1_ingress_list_t *v1_ingress_list_parseFromJSON(cJSON *v1_ingress_listJSON){ goto end; } - list_t *itemsList; - cJSON *items_local_nonprimitive; + cJSON *items_local_nonprimitive = NULL; if(!cJSON_IsArray(items)){ goto end; //nonprimitive container } @@ -178,6 +180,15 @@ v1_ingress_list_t *v1_ingress_list_parseFromJSON(cJSON *v1_ingress_listJSON){ return v1_ingress_list_local_var; end: + if (itemsList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, itemsList) { + v1_ingress_free(listEntry->data); + listEntry->data = NULL; + } + list_freeList(itemsList); + itemsList = NULL; + } if (metadata_local_nonprim) { v1_list_meta_free(metadata_local_nonprim); metadata_local_nonprim = NULL; diff --git a/kubernetes/model/v1_ingress_spec.c b/kubernetes/model/v1_ingress_spec.c index 4553ba3f..4280effb 100644 --- a/kubernetes/model/v1_ingress_spec.c +++ b/kubernetes/model/v1_ingress_spec.c @@ -132,6 +132,12 @@ v1_ingress_spec_t *v1_ingress_spec_parseFromJSON(cJSON *v1_ingress_specJSON){ // define the local variable for v1_ingress_spec->default_backend v1_ingress_backend_t *default_backend_local_nonprim = NULL; + // define the local list for v1_ingress_spec->rules + list_t *rulesList = NULL; + + // define the local list for v1_ingress_spec->tls + list_t *tlsList = NULL; + // v1_ingress_spec->default_backend cJSON *default_backend = cJSON_GetObjectItemCaseSensitive(v1_ingress_specJSON, "defaultBackend"); if (default_backend) { @@ -149,9 +155,8 @@ v1_ingress_spec_t *v1_ingress_spec_parseFromJSON(cJSON *v1_ingress_specJSON){ // v1_ingress_spec->rules cJSON *rules = cJSON_GetObjectItemCaseSensitive(v1_ingress_specJSON, "rules"); - list_t *rulesList; if (rules) { - cJSON *rules_local_nonprimitive; + cJSON *rules_local_nonprimitive = NULL; if(!cJSON_IsArray(rules)){ goto end; //nonprimitive container } @@ -171,9 +176,8 @@ v1_ingress_spec_t *v1_ingress_spec_parseFromJSON(cJSON *v1_ingress_specJSON){ // v1_ingress_spec->tls cJSON *tls = cJSON_GetObjectItemCaseSensitive(v1_ingress_specJSON, "tls"); - list_t *tlsList; if (tls) { - cJSON *tls_local_nonprimitive; + cJSON *tls_local_nonprimitive = NULL; if(!cJSON_IsArray(tls)){ goto end; //nonprimitive container } @@ -205,6 +209,24 @@ v1_ingress_spec_t *v1_ingress_spec_parseFromJSON(cJSON *v1_ingress_specJSON){ v1_ingress_backend_free(default_backend_local_nonprim); default_backend_local_nonprim = NULL; } + if (rulesList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, rulesList) { + v1_ingress_rule_free(listEntry->data); + listEntry->data = NULL; + } + list_freeList(rulesList); + rulesList = NULL; + } + if (tlsList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, tlsList) { + v1_ingress_tls_free(listEntry->data); + listEntry->data = NULL; + } + list_freeList(tlsList); + tlsList = NULL; + } return NULL; } diff --git a/kubernetes/model/v1_ingress_tls.c b/kubernetes/model/v1_ingress_tls.c index 9f4e8601..731ae813 100644 --- a/kubernetes/model/v1_ingress_tls.c +++ b/kubernetes/model/v1_ingress_tls.c @@ -78,11 +78,13 @@ v1_ingress_tls_t *v1_ingress_tls_parseFromJSON(cJSON *v1_ingress_tlsJSON){ v1_ingress_tls_t *v1_ingress_tls_local_var = NULL; + // define the local list for v1_ingress_tls->hosts + list_t *hostsList = NULL; + // v1_ingress_tls->hosts cJSON *hosts = cJSON_GetObjectItemCaseSensitive(v1_ingress_tlsJSON, "hosts"); - list_t *hostsList; if (hosts) { - cJSON *hosts_local; + cJSON *hosts_local = NULL; if(!cJSON_IsArray(hosts)) { goto end;//primitive container } @@ -115,6 +117,15 @@ v1_ingress_tls_t *v1_ingress_tls_parseFromJSON(cJSON *v1_ingress_tlsJSON){ return v1_ingress_tls_local_var; end: + if (hostsList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, hostsList) { + free(listEntry->data); + listEntry->data = NULL; + } + list_freeList(hostsList); + hostsList = NULL; + } return NULL; } diff --git a/kubernetes/model/v1_ip_block.c b/kubernetes/model/v1_ip_block.c index 6980fbed..d751bb38 100644 --- a/kubernetes/model/v1_ip_block.c +++ b/kubernetes/model/v1_ip_block.c @@ -80,6 +80,9 @@ v1_ip_block_t *v1_ip_block_parseFromJSON(cJSON *v1_ip_blockJSON){ v1_ip_block_t *v1_ip_block_local_var = NULL; + // define the local list for v1_ip_block->except + list_t *exceptList = NULL; + // v1_ip_block->cidr cJSON *cidr = cJSON_GetObjectItemCaseSensitive(v1_ip_blockJSON, "cidr"); if (!cidr) { @@ -94,9 +97,8 @@ v1_ip_block_t *v1_ip_block_parseFromJSON(cJSON *v1_ip_blockJSON){ // v1_ip_block->except cJSON *except = cJSON_GetObjectItemCaseSensitive(v1_ip_blockJSON, "except"); - list_t *exceptList; if (except) { - cJSON *except_local; + cJSON *except_local = NULL; if(!cJSON_IsArray(except)) { goto end;//primitive container } @@ -120,6 +122,15 @@ v1_ip_block_t *v1_ip_block_parseFromJSON(cJSON *v1_ip_blockJSON){ return v1_ip_block_local_var; end: + if (exceptList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, exceptList) { + free(listEntry->data); + listEntry->data = NULL; + } + list_freeList(exceptList); + exceptList = NULL; + } return NULL; } diff --git a/kubernetes/model/v1_iscsi_persistent_volume_source.c b/kubernetes/model/v1_iscsi_persistent_volume_source.c index 40847397..1c166b01 100644 --- a/kubernetes/model/v1_iscsi_persistent_volume_source.c +++ b/kubernetes/model/v1_iscsi_persistent_volume_source.c @@ -199,6 +199,9 @@ v1_iscsi_persistent_volume_source_t *v1_iscsi_persistent_volume_source_parseFrom v1_iscsi_persistent_volume_source_t *v1_iscsi_persistent_volume_source_local_var = NULL; + // define the local list for v1_iscsi_persistent_volume_source->portals + list_t *portalsList = NULL; + // define the local variable for v1_iscsi_persistent_volume_source->secret_ref v1_secret_reference_t *secret_ref_local_nonprim = NULL; @@ -273,9 +276,8 @@ v1_iscsi_persistent_volume_source_t *v1_iscsi_persistent_volume_source_parseFrom // v1_iscsi_persistent_volume_source->portals cJSON *portals = cJSON_GetObjectItemCaseSensitive(v1_iscsi_persistent_volume_sourceJSON, "portals"); - list_t *portalsList; if (portals) { - cJSON *portals_local; + cJSON *portals_local = NULL; if(!cJSON_IsArray(portals)) { goto end;//primitive container } @@ -335,6 +337,15 @@ v1_iscsi_persistent_volume_source_t *v1_iscsi_persistent_volume_source_parseFrom return v1_iscsi_persistent_volume_source_local_var; end: + if (portalsList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, portalsList) { + free(listEntry->data); + listEntry->data = NULL; + } + list_freeList(portalsList); + portalsList = NULL; + } if (secret_ref_local_nonprim) { v1_secret_reference_free(secret_ref_local_nonprim); secret_ref_local_nonprim = NULL; diff --git a/kubernetes/model/v1_iscsi_volume_source.c b/kubernetes/model/v1_iscsi_volume_source.c index 25801e87..24d4b608 100644 --- a/kubernetes/model/v1_iscsi_volume_source.c +++ b/kubernetes/model/v1_iscsi_volume_source.c @@ -199,6 +199,9 @@ v1_iscsi_volume_source_t *v1_iscsi_volume_source_parseFromJSON(cJSON *v1_iscsi_v v1_iscsi_volume_source_t *v1_iscsi_volume_source_local_var = NULL; + // define the local list for v1_iscsi_volume_source->portals + list_t *portalsList = NULL; + // define the local variable for v1_iscsi_volume_source->secret_ref v1_local_object_reference_t *secret_ref_local_nonprim = NULL; @@ -273,9 +276,8 @@ v1_iscsi_volume_source_t *v1_iscsi_volume_source_parseFromJSON(cJSON *v1_iscsi_v // v1_iscsi_volume_source->portals cJSON *portals = cJSON_GetObjectItemCaseSensitive(v1_iscsi_volume_sourceJSON, "portals"); - list_t *portalsList; if (portals) { - cJSON *portals_local; + cJSON *portals_local = NULL; if(!cJSON_IsArray(portals)) { goto end;//primitive container } @@ -335,6 +337,15 @@ v1_iscsi_volume_source_t *v1_iscsi_volume_source_parseFromJSON(cJSON *v1_iscsi_v return v1_iscsi_volume_source_local_var; end: + if (portalsList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, portalsList) { + free(listEntry->data); + listEntry->data = NULL; + } + list_freeList(portalsList); + portalsList = NULL; + } if (secret_ref_local_nonprim) { v1_local_object_reference_free(secret_ref_local_nonprim); secret_ref_local_nonprim = NULL; diff --git a/kubernetes/model/v1_job_list.c b/kubernetes/model/v1_job_list.c index 07b041b4..42bb83c8 100644 --- a/kubernetes/model/v1_job_list.c +++ b/kubernetes/model/v1_job_list.c @@ -116,6 +116,9 @@ v1_job_list_t *v1_job_list_parseFromJSON(cJSON *v1_job_listJSON){ v1_job_list_t *v1_job_list_local_var = NULL; + // define the local list for v1_job_list->items + list_t *itemsList = NULL; + // define the local variable for v1_job_list->metadata v1_list_meta_t *metadata_local_nonprim = NULL; @@ -134,9 +137,8 @@ v1_job_list_t *v1_job_list_parseFromJSON(cJSON *v1_job_listJSON){ goto end; } - list_t *itemsList; - cJSON *items_local_nonprimitive; + cJSON *items_local_nonprimitive = NULL; if(!cJSON_IsArray(items)){ goto end; //nonprimitive container } @@ -178,6 +180,15 @@ v1_job_list_t *v1_job_list_parseFromJSON(cJSON *v1_job_listJSON){ return v1_job_list_local_var; end: + if (itemsList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, itemsList) { + v1_job_free(listEntry->data); + listEntry->data = NULL; + } + list_freeList(itemsList); + itemsList = NULL; + } if (metadata_local_nonprim) { v1_list_meta_free(metadata_local_nonprim); metadata_local_nonprim = NULL; diff --git a/kubernetes/model/v1_job_status.c b/kubernetes/model/v1_job_status.c index 8833359a..28fc5dbe 100644 --- a/kubernetes/model/v1_job_status.c +++ b/kubernetes/model/v1_job_status.c @@ -158,6 +158,9 @@ v1_job_status_t *v1_job_status_parseFromJSON(cJSON *v1_job_statusJSON){ v1_job_status_t *v1_job_status_local_var = NULL; + // define the local list for v1_job_status->conditions + list_t *conditionsList = NULL; + // define the local variable for v1_job_status->uncounted_terminated_pods v1_uncounted_terminated_pods_t *uncounted_terminated_pods_local_nonprim = NULL; @@ -190,9 +193,8 @@ v1_job_status_t *v1_job_status_parseFromJSON(cJSON *v1_job_statusJSON){ // v1_job_status->conditions cJSON *conditions = cJSON_GetObjectItemCaseSensitive(v1_job_statusJSON, "conditions"); - list_t *conditionsList; if (conditions) { - cJSON *conditions_local_nonprimitive; + cJSON *conditions_local_nonprimitive = NULL; if(!cJSON_IsArray(conditions)){ goto end; //nonprimitive container } @@ -257,6 +259,15 @@ v1_job_status_t *v1_job_status_parseFromJSON(cJSON *v1_job_statusJSON){ return v1_job_status_local_var; end: + if (conditionsList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, conditionsList) { + v1_job_condition_free(listEntry->data); + listEntry->data = NULL; + } + list_freeList(conditionsList); + conditionsList = NULL; + } if (uncounted_terminated_pods_local_nonprim) { v1_uncounted_terminated_pods_free(uncounted_terminated_pods_local_nonprim); uncounted_terminated_pods_local_nonprim = NULL; diff --git a/kubernetes/model/v1_json_schema_props.c b/kubernetes/model/v1_json_schema_props.c index c0ffc6c1..2f923288 100644 --- a/kubernetes/model/v1_json_schema_props.c +++ b/kubernetes/model/v1_json_schema_props.c @@ -751,12 +751,42 @@ v1_json_schema_props_t *v1_json_schema_props_parseFromJSON(cJSON *v1_json_schema v1_json_schema_props_t *v1_json_schema_props_local_var = NULL; + // define the local list for v1_json_schema_props->all_of + list_t *all_ofList = NULL; + + // define the local list for v1_json_schema_props->any_of + list_t *any_ofList = NULL; + + // define the local map for v1_json_schema_props->definitions + list_t *definitionsList = NULL; + + // define the local map for v1_json_schema_props->dependencies + list_t *dependenciesList = NULL; + + // define the local list for v1_json_schema_props->_enum + list_t *_enumList = NULL; + // define the local variable for v1_json_schema_props->external_docs v1_external_documentation_t *external_docs_local_nonprim = NULL; // define the local variable for v1_json_schema_props->_not v1_json_schema_props_t *_not_local_nonprim = NULL; + // define the local list for v1_json_schema_props->one_of + list_t *one_ofList = NULL; + + // define the local map for v1_json_schema_props->pattern_properties + list_t *pattern_propertiesList = NULL; + + // define the local map for v1_json_schema_props->properties + list_t *propertiesList = NULL; + + // define the local list for v1_json_schema_props->required + list_t *requiredList = NULL; + + // define the local list for v1_json_schema_props->x_kubernetes_list_map_keys + list_t *x_kubernetes_list_map_keysList = NULL; + // v1_json_schema_props->ref cJSON *ref = cJSON_GetObjectItemCaseSensitive(v1_json_schema_propsJSON, "$ref"); if (ref) { @@ -791,9 +821,8 @@ v1_json_schema_props_t *v1_json_schema_props_parseFromJSON(cJSON *v1_json_schema // v1_json_schema_props->all_of cJSON *all_of = cJSON_GetObjectItemCaseSensitive(v1_json_schema_propsJSON, "allOf"); - list_t *all_ofList; if (all_of) { - cJSON *all_of_local_nonprimitive; + cJSON *all_of_local_nonprimitive = NULL; if(!cJSON_IsArray(all_of)){ goto end; //nonprimitive container } @@ -813,9 +842,8 @@ v1_json_schema_props_t *v1_json_schema_props_parseFromJSON(cJSON *v1_json_schema // v1_json_schema_props->any_of cJSON *any_of = cJSON_GetObjectItemCaseSensitive(v1_json_schema_propsJSON, "anyOf"); - list_t *any_ofList; if (any_of) { - cJSON *any_of_local_nonprimitive; + cJSON *any_of_local_nonprimitive = NULL; if(!cJSON_IsArray(any_of)){ goto end; //nonprimitive container } @@ -842,26 +870,16 @@ v1_json_schema_props_t *v1_json_schema_props_parseFromJSON(cJSON *v1_json_schema // v1_json_schema_props->definitions cJSON *definitions = cJSON_GetObjectItemCaseSensitive(v1_json_schema_propsJSON, "definitions"); - list_t *definitionsList; if (definitions) { - cJSON *definitions_local_map; - if(!cJSON_IsObject(definitions)) { - goto end;//primitive map container - } - definitionsList = list_createList(); - keyValuePair_t *localMapKeyPair; - cJSON_ArrayForEach(definitions_local_map, definitions) - { - cJSON *localMapObject = definitions_local_map; - list_addElement(definitionsList , localMapKeyPair); - } + + // The data type of the elements in v1_json_schema_props->definitions is currently not supported. + } // v1_json_schema_props->dependencies cJSON *dependencies = cJSON_GetObjectItemCaseSensitive(v1_json_schema_propsJSON, "dependencies"); - list_t *dependenciesList; if (dependencies) { - cJSON *dependencies_local_map; + cJSON *dependencies_local_map = NULL; if(!cJSON_IsObject(dependencies)) { goto end;//primitive map container } @@ -885,9 +903,8 @@ v1_json_schema_props_t *v1_json_schema_props_parseFromJSON(cJSON *v1_json_schema // v1_json_schema_props->_enum cJSON *_enum = cJSON_GetObjectItemCaseSensitive(v1_json_schema_propsJSON, "enum"); - list_t *_enumList; if (_enum) { - cJSON *_enum_local_nonprimitive; + cJSON *_enum_local_nonprimitive = NULL; if(!cJSON_IsArray(_enum)){ goto end; //nonprimitive container } @@ -1059,9 +1076,8 @@ v1_json_schema_props_t *v1_json_schema_props_parseFromJSON(cJSON *v1_json_schema // v1_json_schema_props->one_of cJSON *one_of = cJSON_GetObjectItemCaseSensitive(v1_json_schema_propsJSON, "oneOf"); - list_t *one_ofList; if (one_of) { - cJSON *one_of_local_nonprimitive; + cJSON *one_of_local_nonprimitive = NULL; if(!cJSON_IsArray(one_of)){ goto end; //nonprimitive container } @@ -1090,43 +1106,24 @@ v1_json_schema_props_t *v1_json_schema_props_parseFromJSON(cJSON *v1_json_schema // v1_json_schema_props->pattern_properties cJSON *pattern_properties = cJSON_GetObjectItemCaseSensitive(v1_json_schema_propsJSON, "patternProperties"); - list_t *pattern_propertiesList; if (pattern_properties) { - cJSON *pattern_properties_local_map; - if(!cJSON_IsObject(pattern_properties)) { - goto end;//primitive map container - } - pattern_propertiesList = list_createList(); - keyValuePair_t *localMapKeyPair; - cJSON_ArrayForEach(pattern_properties_local_map, pattern_properties) - { - cJSON *localMapObject = pattern_properties_local_map; - list_addElement(pattern_propertiesList , localMapKeyPair); - } + + // The data type of the elements in v1_json_schema_props->pattern_properties is currently not supported. + } // v1_json_schema_props->properties cJSON *properties = cJSON_GetObjectItemCaseSensitive(v1_json_schema_propsJSON, "properties"); - list_t *propertiesList; if (properties) { - cJSON *properties_local_map; - if(!cJSON_IsObject(properties)) { - goto end;//primitive map container - } - propertiesList = list_createList(); - keyValuePair_t *localMapKeyPair; - cJSON_ArrayForEach(properties_local_map, properties) - { - cJSON *localMapObject = properties_local_map; - list_addElement(propertiesList , localMapKeyPair); - } + + // The data type of the elements in v1_json_schema_props->properties is currently not supported. + } // v1_json_schema_props->required cJSON *required = cJSON_GetObjectItemCaseSensitive(v1_json_schema_propsJSON, "required"); - list_t *requiredList; if (required) { - cJSON *required_local; + cJSON *required_local = NULL; if(!cJSON_IsArray(required)) { goto end;//primitive container } @@ -1189,9 +1186,8 @@ v1_json_schema_props_t *v1_json_schema_props_parseFromJSON(cJSON *v1_json_schema // v1_json_schema_props->x_kubernetes_list_map_keys cJSON *x_kubernetes_list_map_keys = cJSON_GetObjectItemCaseSensitive(v1_json_schema_propsJSON, "x-kubernetes-list-map-keys"); - list_t *x_kubernetes_list_map_keysList; if (x_kubernetes_list_map_keys) { - cJSON *x_kubernetes_list_map_keys_local; + cJSON *x_kubernetes_list_map_keys_local = NULL; if(!cJSON_IsArray(x_kubernetes_list_map_keys)) { goto end;//primitive container } @@ -1283,6 +1279,48 @@ v1_json_schema_props_t *v1_json_schema_props_parseFromJSON(cJSON *v1_json_schema return v1_json_schema_props_local_var; end: + if (all_ofList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, all_ofList) { + v1_json_schema_props_free(listEntry->data); + listEntry->data = NULL; + } + list_freeList(all_ofList); + all_ofList = NULL; + } + if (any_ofList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, any_ofList) { + v1_json_schema_props_free(listEntry->data); + listEntry->data = NULL; + } + list_freeList(any_ofList); + any_ofList = NULL; + } + + // The data type of the elements in v1_json_schema_props->definitions is currently not supported. + + if (dependenciesList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, dependenciesList) { + keyValuePair_t *localKeyValue = (keyValuePair_t*) listEntry->data; + free(localKeyValue->key); + localKeyValue->key = NULL; + keyValuePair_free(localKeyValue); + localKeyValue = NULL; + } + list_freeList(dependenciesList); + dependenciesList = NULL; + } + if (_enumList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, _enumList) { + object_free(listEntry->data); + listEntry->data = NULL; + } + list_freeList(_enumList); + _enumList = NULL; + } if (external_docs_local_nonprim) { v1_external_documentation_free(external_docs_local_nonprim); external_docs_local_nonprim = NULL; @@ -1291,6 +1329,39 @@ v1_json_schema_props_t *v1_json_schema_props_parseFromJSON(cJSON *v1_json_schema v1_json_schema_props_free(_not_local_nonprim); _not_local_nonprim = NULL; } + if (one_ofList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, one_ofList) { + v1_json_schema_props_free(listEntry->data); + listEntry->data = NULL; + } + list_freeList(one_ofList); + one_ofList = NULL; + } + + // The data type of the elements in v1_json_schema_props->pattern_properties is currently not supported. + + + // The data type of the elements in v1_json_schema_props->properties is currently not supported. + + if (requiredList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, requiredList) { + free(listEntry->data); + listEntry->data = NULL; + } + list_freeList(requiredList); + requiredList = NULL; + } + if (x_kubernetes_list_map_keysList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, x_kubernetes_list_map_keysList) { + free(listEntry->data); + listEntry->data = NULL; + } + list_freeList(x_kubernetes_list_map_keysList); + x_kubernetes_list_map_keysList = NULL; + } return NULL; } diff --git a/kubernetes/model/v1_label_selector.c b/kubernetes/model/v1_label_selector.c index 84944a12..54c3d90a 100644 --- a/kubernetes/model/v1_label_selector.c +++ b/kubernetes/model/v1_label_selector.c @@ -99,11 +99,16 @@ v1_label_selector_t *v1_label_selector_parseFromJSON(cJSON *v1_label_selectorJSO v1_label_selector_t *v1_label_selector_local_var = NULL; + // define the local list for v1_label_selector->match_expressions + list_t *match_expressionsList = NULL; + + // define the local map for v1_label_selector->match_labels + list_t *match_labelsList = NULL; + // v1_label_selector->match_expressions cJSON *match_expressions = cJSON_GetObjectItemCaseSensitive(v1_label_selectorJSON, "matchExpressions"); - list_t *match_expressionsList; if (match_expressions) { - cJSON *match_expressions_local_nonprimitive; + cJSON *match_expressions_local_nonprimitive = NULL; if(!cJSON_IsArray(match_expressions)){ goto end; //nonprimitive container } @@ -123,9 +128,8 @@ v1_label_selector_t *v1_label_selector_parseFromJSON(cJSON *v1_label_selectorJSO // v1_label_selector->match_labels cJSON *match_labels = cJSON_GetObjectItemCaseSensitive(v1_label_selectorJSON, "matchLabels"); - list_t *match_labelsList; if (match_labels) { - cJSON *match_labels_local_map; + cJSON *match_labels_local_map = NULL; if(!cJSON_IsObject(match_labels)) { goto end;//primitive map container } @@ -151,6 +155,29 @@ v1_label_selector_t *v1_label_selector_parseFromJSON(cJSON *v1_label_selectorJSO return v1_label_selector_local_var; end: + if (match_expressionsList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, match_expressionsList) { + v1_label_selector_requirement_free(listEntry->data); + listEntry->data = NULL; + } + list_freeList(match_expressionsList); + match_expressionsList = NULL; + } + if (match_labelsList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, match_labelsList) { + keyValuePair_t *localKeyValue = (keyValuePair_t*) listEntry->data; + free(localKeyValue->key); + localKeyValue->key = NULL; + free(localKeyValue->value); + localKeyValue->value = NULL; + keyValuePair_free(localKeyValue); + localKeyValue = NULL; + } + list_freeList(match_labelsList); + match_labelsList = NULL; + } return NULL; } diff --git a/kubernetes/model/v1_label_selector_requirement.c b/kubernetes/model/v1_label_selector_requirement.c index 784bb10c..f904ab89 100644 --- a/kubernetes/model/v1_label_selector_requirement.c +++ b/kubernetes/model/v1_label_selector_requirement.c @@ -96,6 +96,9 @@ v1_label_selector_requirement_t *v1_label_selector_requirement_parseFromJSON(cJS v1_label_selector_requirement_t *v1_label_selector_requirement_local_var = NULL; + // define the local list for v1_label_selector_requirement->values + list_t *valuesList = NULL; + // v1_label_selector_requirement->key cJSON *key = cJSON_GetObjectItemCaseSensitive(v1_label_selector_requirementJSON, "key"); if (!key) { @@ -122,9 +125,8 @@ v1_label_selector_requirement_t *v1_label_selector_requirement_parseFromJSON(cJS // v1_label_selector_requirement->values cJSON *values = cJSON_GetObjectItemCaseSensitive(v1_label_selector_requirementJSON, "values"); - list_t *valuesList; if (values) { - cJSON *values_local; + cJSON *values_local = NULL; if(!cJSON_IsArray(values)) { goto end;//primitive container } @@ -149,6 +151,15 @@ v1_label_selector_requirement_t *v1_label_selector_requirement_parseFromJSON(cJS return v1_label_selector_requirement_local_var; end: + if (valuesList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, valuesList) { + free(listEntry->data); + listEntry->data = NULL; + } + list_freeList(valuesList); + valuesList = NULL; + } return NULL; } diff --git a/kubernetes/model/v1_lease_list.c b/kubernetes/model/v1_lease_list.c index 48206027..57ff50ef 100644 --- a/kubernetes/model/v1_lease_list.c +++ b/kubernetes/model/v1_lease_list.c @@ -116,6 +116,9 @@ v1_lease_list_t *v1_lease_list_parseFromJSON(cJSON *v1_lease_listJSON){ v1_lease_list_t *v1_lease_list_local_var = NULL; + // define the local list for v1_lease_list->items + list_t *itemsList = NULL; + // define the local variable for v1_lease_list->metadata v1_list_meta_t *metadata_local_nonprim = NULL; @@ -134,9 +137,8 @@ v1_lease_list_t *v1_lease_list_parseFromJSON(cJSON *v1_lease_listJSON){ goto end; } - list_t *itemsList; - cJSON *items_local_nonprimitive; + cJSON *items_local_nonprimitive = NULL; if(!cJSON_IsArray(items)){ goto end; //nonprimitive container } @@ -178,6 +180,15 @@ v1_lease_list_t *v1_lease_list_parseFromJSON(cJSON *v1_lease_listJSON){ return v1_lease_list_local_var; end: + if (itemsList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, itemsList) { + v1_lease_free(listEntry->data); + listEntry->data = NULL; + } + list_freeList(itemsList); + itemsList = NULL; + } if (metadata_local_nonprim) { v1_list_meta_free(metadata_local_nonprim); metadata_local_nonprim = NULL; diff --git a/kubernetes/model/v1_limit_range_item.c b/kubernetes/model/v1_limit_range_item.c index ee57b32b..d6c581ad 100644 --- a/kubernetes/model/v1_limit_range_item.c +++ b/kubernetes/model/v1_limit_range_item.c @@ -214,11 +214,25 @@ v1_limit_range_item_t *v1_limit_range_item_parseFromJSON(cJSON *v1_limit_range_i v1_limit_range_item_t *v1_limit_range_item_local_var = NULL; + // define the local map for v1_limit_range_item->_default + list_t *_defaultList = NULL; + + // define the local map for v1_limit_range_item->default_request + list_t *default_requestList = NULL; + + // define the local map for v1_limit_range_item->max + list_t *maxList = NULL; + + // define the local map for v1_limit_range_item->max_limit_request_ratio + list_t *max_limit_request_ratioList = NULL; + + // define the local map for v1_limit_range_item->min + list_t *minList = NULL; + // v1_limit_range_item->_default cJSON *_default = cJSON_GetObjectItemCaseSensitive(v1_limit_range_itemJSON, "default"); - list_t *_defaultList; if (_default) { - cJSON *_default_local_map; + cJSON *_default_local_map = NULL; if(!cJSON_IsObject(_default)) { goto end;//primitive map container } @@ -238,9 +252,8 @@ v1_limit_range_item_t *v1_limit_range_item_parseFromJSON(cJSON *v1_limit_range_i // v1_limit_range_item->default_request cJSON *default_request = cJSON_GetObjectItemCaseSensitive(v1_limit_range_itemJSON, "defaultRequest"); - list_t *default_requestList; if (default_request) { - cJSON *default_request_local_map; + cJSON *default_request_local_map = NULL; if(!cJSON_IsObject(default_request)) { goto end;//primitive map container } @@ -260,9 +273,8 @@ v1_limit_range_item_t *v1_limit_range_item_parseFromJSON(cJSON *v1_limit_range_i // v1_limit_range_item->max cJSON *max = cJSON_GetObjectItemCaseSensitive(v1_limit_range_itemJSON, "max"); - list_t *maxList; if (max) { - cJSON *max_local_map; + cJSON *max_local_map = NULL; if(!cJSON_IsObject(max)) { goto end;//primitive map container } @@ -282,9 +294,8 @@ v1_limit_range_item_t *v1_limit_range_item_parseFromJSON(cJSON *v1_limit_range_i // v1_limit_range_item->max_limit_request_ratio cJSON *max_limit_request_ratio = cJSON_GetObjectItemCaseSensitive(v1_limit_range_itemJSON, "maxLimitRequestRatio"); - list_t *max_limit_request_ratioList; if (max_limit_request_ratio) { - cJSON *max_limit_request_ratio_local_map; + cJSON *max_limit_request_ratio_local_map = NULL; if(!cJSON_IsObject(max_limit_request_ratio)) { goto end;//primitive map container } @@ -304,9 +315,8 @@ v1_limit_range_item_t *v1_limit_range_item_parseFromJSON(cJSON *v1_limit_range_i // v1_limit_range_item->min cJSON *min = cJSON_GetObjectItemCaseSensitive(v1_limit_range_itemJSON, "min"); - list_t *minList; if (min) { - cJSON *min_local_map; + cJSON *min_local_map = NULL; if(!cJSON_IsObject(min)) { goto end;//primitive map container } @@ -348,6 +358,76 @@ v1_limit_range_item_t *v1_limit_range_item_parseFromJSON(cJSON *v1_limit_range_i return v1_limit_range_item_local_var; end: + if (_defaultList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, _defaultList) { + keyValuePair_t *localKeyValue = (keyValuePair_t*) listEntry->data; + free(localKeyValue->key); + localKeyValue->key = NULL; + free(localKeyValue->value); + localKeyValue->value = NULL; + keyValuePair_free(localKeyValue); + localKeyValue = NULL; + } + list_freeList(_defaultList); + _defaultList = NULL; + } + if (default_requestList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, default_requestList) { + keyValuePair_t *localKeyValue = (keyValuePair_t*) listEntry->data; + free(localKeyValue->key); + localKeyValue->key = NULL; + free(localKeyValue->value); + localKeyValue->value = NULL; + keyValuePair_free(localKeyValue); + localKeyValue = NULL; + } + list_freeList(default_requestList); + default_requestList = NULL; + } + if (maxList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, maxList) { + keyValuePair_t *localKeyValue = (keyValuePair_t*) listEntry->data; + free(localKeyValue->key); + localKeyValue->key = NULL; + free(localKeyValue->value); + localKeyValue->value = NULL; + keyValuePair_free(localKeyValue); + localKeyValue = NULL; + } + list_freeList(maxList); + maxList = NULL; + } + if (max_limit_request_ratioList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, max_limit_request_ratioList) { + keyValuePair_t *localKeyValue = (keyValuePair_t*) listEntry->data; + free(localKeyValue->key); + localKeyValue->key = NULL; + free(localKeyValue->value); + localKeyValue->value = NULL; + keyValuePair_free(localKeyValue); + localKeyValue = NULL; + } + list_freeList(max_limit_request_ratioList); + max_limit_request_ratioList = NULL; + } + if (minList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, minList) { + keyValuePair_t *localKeyValue = (keyValuePair_t*) listEntry->data; + free(localKeyValue->key); + localKeyValue->key = NULL; + free(localKeyValue->value); + localKeyValue->value = NULL; + keyValuePair_free(localKeyValue); + localKeyValue = NULL; + } + list_freeList(minList); + minList = NULL; + } return NULL; } diff --git a/kubernetes/model/v1_limit_range_list.c b/kubernetes/model/v1_limit_range_list.c index 572ad715..b440121f 100644 --- a/kubernetes/model/v1_limit_range_list.c +++ b/kubernetes/model/v1_limit_range_list.c @@ -116,6 +116,9 @@ v1_limit_range_list_t *v1_limit_range_list_parseFromJSON(cJSON *v1_limit_range_l v1_limit_range_list_t *v1_limit_range_list_local_var = NULL; + // define the local list for v1_limit_range_list->items + list_t *itemsList = NULL; + // define the local variable for v1_limit_range_list->metadata v1_list_meta_t *metadata_local_nonprim = NULL; @@ -134,9 +137,8 @@ v1_limit_range_list_t *v1_limit_range_list_parseFromJSON(cJSON *v1_limit_range_l goto end; } - list_t *itemsList; - cJSON *items_local_nonprimitive; + cJSON *items_local_nonprimitive = NULL; if(!cJSON_IsArray(items)){ goto end; //nonprimitive container } @@ -178,6 +180,15 @@ v1_limit_range_list_t *v1_limit_range_list_parseFromJSON(cJSON *v1_limit_range_l return v1_limit_range_list_local_var; end: + if (itemsList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, itemsList) { + v1_limit_range_free(listEntry->data); + listEntry->data = NULL; + } + list_freeList(itemsList); + itemsList = NULL; + } if (metadata_local_nonprim) { v1_list_meta_free(metadata_local_nonprim); metadata_local_nonprim = NULL; diff --git a/kubernetes/model/v1_limit_range_spec.c b/kubernetes/model/v1_limit_range_spec.c index e8dd7fa2..c977d9f6 100644 --- a/kubernetes/model/v1_limit_range_spec.c +++ b/kubernetes/model/v1_limit_range_spec.c @@ -69,15 +69,17 @@ v1_limit_range_spec_t *v1_limit_range_spec_parseFromJSON(cJSON *v1_limit_range_s v1_limit_range_spec_t *v1_limit_range_spec_local_var = NULL; + // define the local list for v1_limit_range_spec->limits + list_t *limitsList = NULL; + // v1_limit_range_spec->limits cJSON *limits = cJSON_GetObjectItemCaseSensitive(v1_limit_range_specJSON, "limits"); if (!limits) { goto end; } - list_t *limitsList; - cJSON *limits_local_nonprimitive; + cJSON *limits_local_nonprimitive = NULL; if(!cJSON_IsArray(limits)){ goto end; //nonprimitive container } @@ -101,6 +103,15 @@ v1_limit_range_spec_t *v1_limit_range_spec_parseFromJSON(cJSON *v1_limit_range_s return v1_limit_range_spec_local_var; end: + if (limitsList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, limitsList) { + v1_limit_range_item_free(listEntry->data); + listEntry->data = NULL; + } + list_freeList(limitsList); + limitsList = NULL; + } return NULL; } diff --git a/kubernetes/model/v1_load_balancer_ingress.c b/kubernetes/model/v1_load_balancer_ingress.c index 217bda81..53a477e2 100644 --- a/kubernetes/model/v1_load_balancer_ingress.c +++ b/kubernetes/model/v1_load_balancer_ingress.c @@ -95,6 +95,9 @@ v1_load_balancer_ingress_t *v1_load_balancer_ingress_parseFromJSON(cJSON *v1_loa v1_load_balancer_ingress_t *v1_load_balancer_ingress_local_var = NULL; + // define the local list for v1_load_balancer_ingress->ports + list_t *portsList = NULL; + // v1_load_balancer_ingress->hostname cJSON *hostname = cJSON_GetObjectItemCaseSensitive(v1_load_balancer_ingressJSON, "hostname"); if (hostname) { @@ -115,9 +118,8 @@ v1_load_balancer_ingress_t *v1_load_balancer_ingress_parseFromJSON(cJSON *v1_loa // v1_load_balancer_ingress->ports cJSON *ports = cJSON_GetObjectItemCaseSensitive(v1_load_balancer_ingressJSON, "ports"); - list_t *portsList; if (ports) { - cJSON *ports_local_nonprimitive; + cJSON *ports_local_nonprimitive = NULL; if(!cJSON_IsArray(ports)){ goto end; //nonprimitive container } @@ -144,6 +146,15 @@ v1_load_balancer_ingress_t *v1_load_balancer_ingress_parseFromJSON(cJSON *v1_loa return v1_load_balancer_ingress_local_var; end: + if (portsList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, portsList) { + v1_port_status_free(listEntry->data); + listEntry->data = NULL; + } + list_freeList(portsList); + portsList = NULL; + } return NULL; } diff --git a/kubernetes/model/v1_load_balancer_status.c b/kubernetes/model/v1_load_balancer_status.c index a35c1583..5babe933 100644 --- a/kubernetes/model/v1_load_balancer_status.c +++ b/kubernetes/model/v1_load_balancer_status.c @@ -67,11 +67,13 @@ v1_load_balancer_status_t *v1_load_balancer_status_parseFromJSON(cJSON *v1_load_ v1_load_balancer_status_t *v1_load_balancer_status_local_var = NULL; + // define the local list for v1_load_balancer_status->ingress + list_t *ingressList = NULL; + // v1_load_balancer_status->ingress cJSON *ingress = cJSON_GetObjectItemCaseSensitive(v1_load_balancer_statusJSON, "ingress"); - list_t *ingressList; if (ingress) { - cJSON *ingress_local_nonprimitive; + cJSON *ingress_local_nonprimitive = NULL; if(!cJSON_IsArray(ingress)){ goto end; //nonprimitive container } @@ -96,6 +98,15 @@ v1_load_balancer_status_t *v1_load_balancer_status_parseFromJSON(cJSON *v1_load_ return v1_load_balancer_status_local_var; end: + if (ingressList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, ingressList) { + v1_load_balancer_ingress_free(listEntry->data); + listEntry->data = NULL; + } + list_freeList(ingressList); + ingressList = NULL; + } return NULL; } diff --git a/kubernetes/model/v1_mutating_webhook.c b/kubernetes/model/v1_mutating_webhook.c index 75617156..5fdab5e3 100644 --- a/kubernetes/model/v1_mutating_webhook.c +++ b/kubernetes/model/v1_mutating_webhook.c @@ -238,6 +238,9 @@ v1_mutating_webhook_t *v1_mutating_webhook_parseFromJSON(cJSON *v1_mutating_webh v1_mutating_webhook_t *v1_mutating_webhook_local_var = NULL; + // define the local list for v1_mutating_webhook->admission_review_versions + list_t *admission_review_versionsList = NULL; + // define the local variable for v1_mutating_webhook->client_config admissionregistration_v1_webhook_client_config_t *client_config_local_nonprim = NULL; @@ -247,15 +250,17 @@ v1_mutating_webhook_t *v1_mutating_webhook_parseFromJSON(cJSON *v1_mutating_webh // define the local variable for v1_mutating_webhook->object_selector v1_label_selector_t *object_selector_local_nonprim = NULL; + // define the local list for v1_mutating_webhook->rules + list_t *rulesList = NULL; + // v1_mutating_webhook->admission_review_versions cJSON *admission_review_versions = cJSON_GetObjectItemCaseSensitive(v1_mutating_webhookJSON, "admissionReviewVersions"); if (!admission_review_versions) { goto end; } - list_t *admission_review_versionsList; - cJSON *admission_review_versions_local; + cJSON *admission_review_versions_local = NULL; if(!cJSON_IsArray(admission_review_versions)) { goto end;//primitive container } @@ -332,9 +337,8 @@ v1_mutating_webhook_t *v1_mutating_webhook_parseFromJSON(cJSON *v1_mutating_webh // v1_mutating_webhook->rules cJSON *rules = cJSON_GetObjectItemCaseSensitive(v1_mutating_webhookJSON, "rules"); - list_t *rulesList; if (rules) { - cJSON *rules_local_nonprimitive; + cJSON *rules_local_nonprimitive = NULL; if(!cJSON_IsArray(rules)){ goto end; //nonprimitive container } @@ -390,6 +394,15 @@ v1_mutating_webhook_t *v1_mutating_webhook_parseFromJSON(cJSON *v1_mutating_webh return v1_mutating_webhook_local_var; end: + if (admission_review_versionsList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, admission_review_versionsList) { + free(listEntry->data); + listEntry->data = NULL; + } + list_freeList(admission_review_versionsList); + admission_review_versionsList = NULL; + } if (client_config_local_nonprim) { admissionregistration_v1_webhook_client_config_free(client_config_local_nonprim); client_config_local_nonprim = NULL; @@ -402,6 +415,15 @@ v1_mutating_webhook_t *v1_mutating_webhook_parseFromJSON(cJSON *v1_mutating_webh v1_label_selector_free(object_selector_local_nonprim); object_selector_local_nonprim = NULL; } + if (rulesList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, rulesList) { + v1_rule_with_operations_free(listEntry->data); + listEntry->data = NULL; + } + list_freeList(rulesList); + rulesList = NULL; + } return NULL; } diff --git a/kubernetes/model/v1_mutating_webhook_configuration.c b/kubernetes/model/v1_mutating_webhook_configuration.c index 4b000678..489d08d6 100644 --- a/kubernetes/model/v1_mutating_webhook_configuration.c +++ b/kubernetes/model/v1_mutating_webhook_configuration.c @@ -117,6 +117,9 @@ v1_mutating_webhook_configuration_t *v1_mutating_webhook_configuration_parseFrom // define the local variable for v1_mutating_webhook_configuration->metadata v1_object_meta_t *metadata_local_nonprim = NULL; + // define the local list for v1_mutating_webhook_configuration->webhooks + list_t *webhooksList = NULL; + // v1_mutating_webhook_configuration->api_version cJSON *api_version = cJSON_GetObjectItemCaseSensitive(v1_mutating_webhook_configurationJSON, "apiVersion"); if (api_version) { @@ -143,9 +146,8 @@ v1_mutating_webhook_configuration_t *v1_mutating_webhook_configuration_parseFrom // v1_mutating_webhook_configuration->webhooks cJSON *webhooks = cJSON_GetObjectItemCaseSensitive(v1_mutating_webhook_configurationJSON, "webhooks"); - list_t *webhooksList; if (webhooks) { - cJSON *webhooks_local_nonprimitive; + cJSON *webhooks_local_nonprimitive = NULL; if(!cJSON_IsArray(webhooks)){ goto end; //nonprimitive container } @@ -177,6 +179,15 @@ v1_mutating_webhook_configuration_t *v1_mutating_webhook_configuration_parseFrom v1_object_meta_free(metadata_local_nonprim); metadata_local_nonprim = NULL; } + if (webhooksList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, webhooksList) { + v1_mutating_webhook_free(listEntry->data); + listEntry->data = NULL; + } + list_freeList(webhooksList); + webhooksList = NULL; + } return NULL; } diff --git a/kubernetes/model/v1_mutating_webhook_configuration_list.c b/kubernetes/model/v1_mutating_webhook_configuration_list.c index e568c6eb..b3b8735c 100644 --- a/kubernetes/model/v1_mutating_webhook_configuration_list.c +++ b/kubernetes/model/v1_mutating_webhook_configuration_list.c @@ -116,6 +116,9 @@ v1_mutating_webhook_configuration_list_t *v1_mutating_webhook_configuration_list v1_mutating_webhook_configuration_list_t *v1_mutating_webhook_configuration_list_local_var = NULL; + // define the local list for v1_mutating_webhook_configuration_list->items + list_t *itemsList = NULL; + // define the local variable for v1_mutating_webhook_configuration_list->metadata v1_list_meta_t *metadata_local_nonprim = NULL; @@ -134,9 +137,8 @@ v1_mutating_webhook_configuration_list_t *v1_mutating_webhook_configuration_list goto end; } - list_t *itemsList; - cJSON *items_local_nonprimitive; + cJSON *items_local_nonprimitive = NULL; if(!cJSON_IsArray(items)){ goto end; //nonprimitive container } @@ -178,6 +180,15 @@ v1_mutating_webhook_configuration_list_t *v1_mutating_webhook_configuration_list return v1_mutating_webhook_configuration_list_local_var; end: + if (itemsList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, itemsList) { + v1_mutating_webhook_configuration_free(listEntry->data); + listEntry->data = NULL; + } + list_freeList(itemsList); + itemsList = NULL; + } if (metadata_local_nonprim) { v1_list_meta_free(metadata_local_nonprim); metadata_local_nonprim = NULL; diff --git a/kubernetes/model/v1_namespace_list.c b/kubernetes/model/v1_namespace_list.c index 9dc2ff07..cd2a1585 100644 --- a/kubernetes/model/v1_namespace_list.c +++ b/kubernetes/model/v1_namespace_list.c @@ -116,6 +116,9 @@ v1_namespace_list_t *v1_namespace_list_parseFromJSON(cJSON *v1_namespace_listJSO v1_namespace_list_t *v1_namespace_list_local_var = NULL; + // define the local list for v1_namespace_list->items + list_t *itemsList = NULL; + // define the local variable for v1_namespace_list->metadata v1_list_meta_t *metadata_local_nonprim = NULL; @@ -134,9 +137,8 @@ v1_namespace_list_t *v1_namespace_list_parseFromJSON(cJSON *v1_namespace_listJSO goto end; } - list_t *itemsList; - cJSON *items_local_nonprimitive; + cJSON *items_local_nonprimitive = NULL; if(!cJSON_IsArray(items)){ goto end; //nonprimitive container } @@ -178,6 +180,15 @@ v1_namespace_list_t *v1_namespace_list_parseFromJSON(cJSON *v1_namespace_listJSO return v1_namespace_list_local_var; end: + if (itemsList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, itemsList) { + v1_namespace_free(listEntry->data); + listEntry->data = NULL; + } + list_freeList(itemsList); + itemsList = NULL; + } if (metadata_local_nonprim) { v1_list_meta_free(metadata_local_nonprim); metadata_local_nonprim = NULL; diff --git a/kubernetes/model/v1_namespace_spec.c b/kubernetes/model/v1_namespace_spec.c index c6b79b6f..8b47a325 100644 --- a/kubernetes/model/v1_namespace_spec.c +++ b/kubernetes/model/v1_namespace_spec.c @@ -64,11 +64,13 @@ v1_namespace_spec_t *v1_namespace_spec_parseFromJSON(cJSON *v1_namespace_specJSO v1_namespace_spec_t *v1_namespace_spec_local_var = NULL; + // define the local list for v1_namespace_spec->finalizers + list_t *finalizersList = NULL; + // v1_namespace_spec->finalizers cJSON *finalizers = cJSON_GetObjectItemCaseSensitive(v1_namespace_specJSON, "finalizers"); - list_t *finalizersList; if (finalizers) { - cJSON *finalizers_local; + cJSON *finalizers_local = NULL; if(!cJSON_IsArray(finalizers)) { goto end;//primitive container } @@ -91,6 +93,15 @@ v1_namespace_spec_t *v1_namespace_spec_parseFromJSON(cJSON *v1_namespace_specJSO return v1_namespace_spec_local_var; end: + if (finalizersList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, finalizersList) { + free(listEntry->data); + listEntry->data = NULL; + } + list_freeList(finalizersList); + finalizersList = NULL; + } return NULL; } diff --git a/kubernetes/model/v1_namespace_status.c b/kubernetes/model/v1_namespace_status.c index 38a20bc8..719b26c4 100644 --- a/kubernetes/model/v1_namespace_status.c +++ b/kubernetes/model/v1_namespace_status.c @@ -81,11 +81,13 @@ v1_namespace_status_t *v1_namespace_status_parseFromJSON(cJSON *v1_namespace_sta v1_namespace_status_t *v1_namespace_status_local_var = NULL; + // define the local list for v1_namespace_status->conditions + list_t *conditionsList = NULL; + // v1_namespace_status->conditions cJSON *conditions = cJSON_GetObjectItemCaseSensitive(v1_namespace_statusJSON, "conditions"); - list_t *conditionsList; if (conditions) { - cJSON *conditions_local_nonprimitive; + cJSON *conditions_local_nonprimitive = NULL; if(!cJSON_IsArray(conditions)){ goto end; //nonprimitive container } @@ -120,6 +122,15 @@ v1_namespace_status_t *v1_namespace_status_parseFromJSON(cJSON *v1_namespace_sta return v1_namespace_status_local_var; end: + if (conditionsList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, conditionsList) { + v1_namespace_condition_free(listEntry->data); + listEntry->data = NULL; + } + list_freeList(conditionsList); + conditionsList = NULL; + } return NULL; } diff --git a/kubernetes/model/v1_network_policy_egress_rule.c b/kubernetes/model/v1_network_policy_egress_rule.c index b6476e82..851b4ce8 100644 --- a/kubernetes/model/v1_network_policy_egress_rule.c +++ b/kubernetes/model/v1_network_policy_egress_rule.c @@ -96,11 +96,16 @@ v1_network_policy_egress_rule_t *v1_network_policy_egress_rule_parseFromJSON(cJS v1_network_policy_egress_rule_t *v1_network_policy_egress_rule_local_var = NULL; + // define the local list for v1_network_policy_egress_rule->ports + list_t *portsList = NULL; + + // define the local list for v1_network_policy_egress_rule->to + list_t *toList = NULL; + // v1_network_policy_egress_rule->ports cJSON *ports = cJSON_GetObjectItemCaseSensitive(v1_network_policy_egress_ruleJSON, "ports"); - list_t *portsList; if (ports) { - cJSON *ports_local_nonprimitive; + cJSON *ports_local_nonprimitive = NULL; if(!cJSON_IsArray(ports)){ goto end; //nonprimitive container } @@ -120,9 +125,8 @@ v1_network_policy_egress_rule_t *v1_network_policy_egress_rule_parseFromJSON(cJS // v1_network_policy_egress_rule->to cJSON *to = cJSON_GetObjectItemCaseSensitive(v1_network_policy_egress_ruleJSON, "to"); - list_t *toList; if (to) { - cJSON *to_local_nonprimitive; + cJSON *to_local_nonprimitive = NULL; if(!cJSON_IsArray(to)){ goto end; //nonprimitive container } @@ -148,6 +152,24 @@ v1_network_policy_egress_rule_t *v1_network_policy_egress_rule_parseFromJSON(cJS return v1_network_policy_egress_rule_local_var; end: + if (portsList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, portsList) { + v1_network_policy_port_free(listEntry->data); + listEntry->data = NULL; + } + list_freeList(portsList); + portsList = NULL; + } + if (toList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, toList) { + v1_network_policy_peer_free(listEntry->data); + listEntry->data = NULL; + } + list_freeList(toList); + toList = NULL; + } return NULL; } diff --git a/kubernetes/model/v1_network_policy_ingress_rule.c b/kubernetes/model/v1_network_policy_ingress_rule.c index 9e542b6b..b59c4794 100644 --- a/kubernetes/model/v1_network_policy_ingress_rule.c +++ b/kubernetes/model/v1_network_policy_ingress_rule.c @@ -96,11 +96,16 @@ v1_network_policy_ingress_rule_t *v1_network_policy_ingress_rule_parseFromJSON(c v1_network_policy_ingress_rule_t *v1_network_policy_ingress_rule_local_var = NULL; + // define the local list for v1_network_policy_ingress_rule->from + list_t *fromList = NULL; + + // define the local list for v1_network_policy_ingress_rule->ports + list_t *portsList = NULL; + // v1_network_policy_ingress_rule->from cJSON *from = cJSON_GetObjectItemCaseSensitive(v1_network_policy_ingress_ruleJSON, "from"); - list_t *fromList; if (from) { - cJSON *from_local_nonprimitive; + cJSON *from_local_nonprimitive = NULL; if(!cJSON_IsArray(from)){ goto end; //nonprimitive container } @@ -120,9 +125,8 @@ v1_network_policy_ingress_rule_t *v1_network_policy_ingress_rule_parseFromJSON(c // v1_network_policy_ingress_rule->ports cJSON *ports = cJSON_GetObjectItemCaseSensitive(v1_network_policy_ingress_ruleJSON, "ports"); - list_t *portsList; if (ports) { - cJSON *ports_local_nonprimitive; + cJSON *ports_local_nonprimitive = NULL; if(!cJSON_IsArray(ports)){ goto end; //nonprimitive container } @@ -148,6 +152,24 @@ v1_network_policy_ingress_rule_t *v1_network_policy_ingress_rule_parseFromJSON(c return v1_network_policy_ingress_rule_local_var; end: + if (fromList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, fromList) { + v1_network_policy_peer_free(listEntry->data); + listEntry->data = NULL; + } + list_freeList(fromList); + fromList = NULL; + } + if (portsList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, portsList) { + v1_network_policy_port_free(listEntry->data); + listEntry->data = NULL; + } + list_freeList(portsList); + portsList = NULL; + } return NULL; } diff --git a/kubernetes/model/v1_network_policy_list.c b/kubernetes/model/v1_network_policy_list.c index 173b642a..efbd58bd 100644 --- a/kubernetes/model/v1_network_policy_list.c +++ b/kubernetes/model/v1_network_policy_list.c @@ -116,6 +116,9 @@ v1_network_policy_list_t *v1_network_policy_list_parseFromJSON(cJSON *v1_network v1_network_policy_list_t *v1_network_policy_list_local_var = NULL; + // define the local list for v1_network_policy_list->items + list_t *itemsList = NULL; + // define the local variable for v1_network_policy_list->metadata v1_list_meta_t *metadata_local_nonprim = NULL; @@ -134,9 +137,8 @@ v1_network_policy_list_t *v1_network_policy_list_parseFromJSON(cJSON *v1_network goto end; } - list_t *itemsList; - cJSON *items_local_nonprimitive; + cJSON *items_local_nonprimitive = NULL; if(!cJSON_IsArray(items)){ goto end; //nonprimitive container } @@ -178,6 +180,15 @@ v1_network_policy_list_t *v1_network_policy_list_parseFromJSON(cJSON *v1_network return v1_network_policy_list_local_var; end: + if (itemsList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, itemsList) { + v1_network_policy_free(listEntry->data); + listEntry->data = NULL; + } + list_freeList(itemsList); + itemsList = NULL; + } if (metadata_local_nonprim) { v1_list_meta_free(metadata_local_nonprim); metadata_local_nonprim = NULL; diff --git a/kubernetes/model/v1_network_policy_spec.c b/kubernetes/model/v1_network_policy_spec.c index 5e0d5fd3..446c6ddc 100644 --- a/kubernetes/model/v1_network_policy_spec.c +++ b/kubernetes/model/v1_network_policy_spec.c @@ -143,14 +143,22 @@ v1_network_policy_spec_t *v1_network_policy_spec_parseFromJSON(cJSON *v1_network v1_network_policy_spec_t *v1_network_policy_spec_local_var = NULL; + // define the local list for v1_network_policy_spec->egress + list_t *egressList = NULL; + + // define the local list for v1_network_policy_spec->ingress + list_t *ingressList = NULL; + // define the local variable for v1_network_policy_spec->pod_selector v1_label_selector_t *pod_selector_local_nonprim = NULL; + // define the local list for v1_network_policy_spec->policy_types + list_t *policy_typesList = NULL; + // v1_network_policy_spec->egress cJSON *egress = cJSON_GetObjectItemCaseSensitive(v1_network_policy_specJSON, "egress"); - list_t *egressList; if (egress) { - cJSON *egress_local_nonprimitive; + cJSON *egress_local_nonprimitive = NULL; if(!cJSON_IsArray(egress)){ goto end; //nonprimitive container } @@ -170,9 +178,8 @@ v1_network_policy_spec_t *v1_network_policy_spec_parseFromJSON(cJSON *v1_network // v1_network_policy_spec->ingress cJSON *ingress = cJSON_GetObjectItemCaseSensitive(v1_network_policy_specJSON, "ingress"); - list_t *ingressList; if (ingress) { - cJSON *ingress_local_nonprimitive; + cJSON *ingress_local_nonprimitive = NULL; if(!cJSON_IsArray(ingress)){ goto end; //nonprimitive container } @@ -201,9 +208,8 @@ v1_network_policy_spec_t *v1_network_policy_spec_parseFromJSON(cJSON *v1_network // v1_network_policy_spec->policy_types cJSON *policy_types = cJSON_GetObjectItemCaseSensitive(v1_network_policy_specJSON, "policyTypes"); - list_t *policy_typesList; if (policy_types) { - cJSON *policy_types_local; + cJSON *policy_types_local = NULL; if(!cJSON_IsArray(policy_types)) { goto end;//primitive container } @@ -229,10 +235,37 @@ v1_network_policy_spec_t *v1_network_policy_spec_parseFromJSON(cJSON *v1_network return v1_network_policy_spec_local_var; end: + if (egressList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, egressList) { + v1_network_policy_egress_rule_free(listEntry->data); + listEntry->data = NULL; + } + list_freeList(egressList); + egressList = NULL; + } + if (ingressList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, ingressList) { + v1_network_policy_ingress_rule_free(listEntry->data); + listEntry->data = NULL; + } + list_freeList(ingressList); + ingressList = NULL; + } if (pod_selector_local_nonprim) { v1_label_selector_free(pod_selector_local_nonprim); pod_selector_local_nonprim = NULL; } + if (policy_typesList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, policy_typesList) { + free(listEntry->data); + listEntry->data = NULL; + } + list_freeList(policy_typesList); + policy_typesList = NULL; + } return NULL; } diff --git a/kubernetes/model/v1_node_affinity.c b/kubernetes/model/v1_node_affinity.c index fd609320..05abc89e 100644 --- a/kubernetes/model/v1_node_affinity.c +++ b/kubernetes/model/v1_node_affinity.c @@ -86,14 +86,16 @@ v1_node_affinity_t *v1_node_affinity_parseFromJSON(cJSON *v1_node_affinityJSON){ v1_node_affinity_t *v1_node_affinity_local_var = NULL; + // define the local list for v1_node_affinity->preferred_during_scheduling_ignored_during_execution + list_t *preferred_during_scheduling_ignored_during_executionList = NULL; + // define the local variable for v1_node_affinity->required_during_scheduling_ignored_during_execution v1_node_selector_t *required_during_scheduling_ignored_during_execution_local_nonprim = NULL; // v1_node_affinity->preferred_during_scheduling_ignored_during_execution cJSON *preferred_during_scheduling_ignored_during_execution = cJSON_GetObjectItemCaseSensitive(v1_node_affinityJSON, "preferredDuringSchedulingIgnoredDuringExecution"); - list_t *preferred_during_scheduling_ignored_during_executionList; if (preferred_during_scheduling_ignored_during_execution) { - cJSON *preferred_during_scheduling_ignored_during_execution_local_nonprimitive; + cJSON *preferred_during_scheduling_ignored_during_execution_local_nonprimitive = NULL; if(!cJSON_IsArray(preferred_during_scheduling_ignored_during_execution)){ goto end; //nonprimitive container } @@ -125,6 +127,15 @@ v1_node_affinity_t *v1_node_affinity_parseFromJSON(cJSON *v1_node_affinityJSON){ return v1_node_affinity_local_var; end: + if (preferred_during_scheduling_ignored_during_executionList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, preferred_during_scheduling_ignored_during_executionList) { + v1_preferred_scheduling_term_free(listEntry->data); + listEntry->data = NULL; + } + list_freeList(preferred_during_scheduling_ignored_during_executionList); + preferred_during_scheduling_ignored_during_executionList = NULL; + } if (required_during_scheduling_ignored_during_execution_local_nonprim) { v1_node_selector_free(required_during_scheduling_ignored_during_execution_local_nonprim); required_during_scheduling_ignored_during_execution_local_nonprim = NULL; diff --git a/kubernetes/model/v1_node_list.c b/kubernetes/model/v1_node_list.c index 942a3908..de0de475 100644 --- a/kubernetes/model/v1_node_list.c +++ b/kubernetes/model/v1_node_list.c @@ -116,6 +116,9 @@ v1_node_list_t *v1_node_list_parseFromJSON(cJSON *v1_node_listJSON){ v1_node_list_t *v1_node_list_local_var = NULL; + // define the local list for v1_node_list->items + list_t *itemsList = NULL; + // define the local variable for v1_node_list->metadata v1_list_meta_t *metadata_local_nonprim = NULL; @@ -134,9 +137,8 @@ v1_node_list_t *v1_node_list_parseFromJSON(cJSON *v1_node_listJSON){ goto end; } - list_t *itemsList; - cJSON *items_local_nonprimitive; + cJSON *items_local_nonprimitive = NULL; if(!cJSON_IsArray(items)){ goto end; //nonprimitive container } @@ -178,6 +180,15 @@ v1_node_list_t *v1_node_list_parseFromJSON(cJSON *v1_node_listJSON){ return v1_node_list_local_var; end: + if (itemsList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, itemsList) { + v1_node_free(listEntry->data); + listEntry->data = NULL; + } + list_freeList(itemsList); + itemsList = NULL; + } if (metadata_local_nonprim) { v1_list_meta_free(metadata_local_nonprim); metadata_local_nonprim = NULL; diff --git a/kubernetes/model/v1_node_selector.c b/kubernetes/model/v1_node_selector.c index 8d5449f4..df0d2e84 100644 --- a/kubernetes/model/v1_node_selector.c +++ b/kubernetes/model/v1_node_selector.c @@ -69,15 +69,17 @@ v1_node_selector_t *v1_node_selector_parseFromJSON(cJSON *v1_node_selectorJSON){ v1_node_selector_t *v1_node_selector_local_var = NULL; + // define the local list for v1_node_selector->node_selector_terms + list_t *node_selector_termsList = NULL; + // v1_node_selector->node_selector_terms cJSON *node_selector_terms = cJSON_GetObjectItemCaseSensitive(v1_node_selectorJSON, "nodeSelectorTerms"); if (!node_selector_terms) { goto end; } - list_t *node_selector_termsList; - cJSON *node_selector_terms_local_nonprimitive; + cJSON *node_selector_terms_local_nonprimitive = NULL; if(!cJSON_IsArray(node_selector_terms)){ goto end; //nonprimitive container } @@ -101,6 +103,15 @@ v1_node_selector_t *v1_node_selector_parseFromJSON(cJSON *v1_node_selectorJSON){ return v1_node_selector_local_var; end: + if (node_selector_termsList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, node_selector_termsList) { + v1_node_selector_term_free(listEntry->data); + listEntry->data = NULL; + } + list_freeList(node_selector_termsList); + node_selector_termsList = NULL; + } return NULL; } diff --git a/kubernetes/model/v1_node_selector_requirement.c b/kubernetes/model/v1_node_selector_requirement.c index b9dd28e0..070745e1 100644 --- a/kubernetes/model/v1_node_selector_requirement.c +++ b/kubernetes/model/v1_node_selector_requirement.c @@ -96,6 +96,9 @@ v1_node_selector_requirement_t *v1_node_selector_requirement_parseFromJSON(cJSON v1_node_selector_requirement_t *v1_node_selector_requirement_local_var = NULL; + // define the local list for v1_node_selector_requirement->values + list_t *valuesList = NULL; + // v1_node_selector_requirement->key cJSON *key = cJSON_GetObjectItemCaseSensitive(v1_node_selector_requirementJSON, "key"); if (!key) { @@ -122,9 +125,8 @@ v1_node_selector_requirement_t *v1_node_selector_requirement_parseFromJSON(cJSON // v1_node_selector_requirement->values cJSON *values = cJSON_GetObjectItemCaseSensitive(v1_node_selector_requirementJSON, "values"); - list_t *valuesList; if (values) { - cJSON *values_local; + cJSON *values_local = NULL; if(!cJSON_IsArray(values)) { goto end;//primitive container } @@ -149,6 +151,15 @@ v1_node_selector_requirement_t *v1_node_selector_requirement_parseFromJSON(cJSON return v1_node_selector_requirement_local_var; end: + if (valuesList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, valuesList) { + free(listEntry->data); + listEntry->data = NULL; + } + list_freeList(valuesList); + valuesList = NULL; + } return NULL; } diff --git a/kubernetes/model/v1_node_selector_term.c b/kubernetes/model/v1_node_selector_term.c index 1b686650..b371efe8 100644 --- a/kubernetes/model/v1_node_selector_term.c +++ b/kubernetes/model/v1_node_selector_term.c @@ -96,11 +96,16 @@ v1_node_selector_term_t *v1_node_selector_term_parseFromJSON(cJSON *v1_node_sele v1_node_selector_term_t *v1_node_selector_term_local_var = NULL; + // define the local list for v1_node_selector_term->match_expressions + list_t *match_expressionsList = NULL; + + // define the local list for v1_node_selector_term->match_fields + list_t *match_fieldsList = NULL; + // v1_node_selector_term->match_expressions cJSON *match_expressions = cJSON_GetObjectItemCaseSensitive(v1_node_selector_termJSON, "matchExpressions"); - list_t *match_expressionsList; if (match_expressions) { - cJSON *match_expressions_local_nonprimitive; + cJSON *match_expressions_local_nonprimitive = NULL; if(!cJSON_IsArray(match_expressions)){ goto end; //nonprimitive container } @@ -120,9 +125,8 @@ v1_node_selector_term_t *v1_node_selector_term_parseFromJSON(cJSON *v1_node_sele // v1_node_selector_term->match_fields cJSON *match_fields = cJSON_GetObjectItemCaseSensitive(v1_node_selector_termJSON, "matchFields"); - list_t *match_fieldsList; if (match_fields) { - cJSON *match_fields_local_nonprimitive; + cJSON *match_fields_local_nonprimitive = NULL; if(!cJSON_IsArray(match_fields)){ goto end; //nonprimitive container } @@ -148,6 +152,24 @@ v1_node_selector_term_t *v1_node_selector_term_parseFromJSON(cJSON *v1_node_sele return v1_node_selector_term_local_var; end: + if (match_expressionsList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, match_expressionsList) { + v1_node_selector_requirement_free(listEntry->data); + listEntry->data = NULL; + } + list_freeList(match_expressionsList); + match_expressionsList = NULL; + } + if (match_fieldsList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, match_fieldsList) { + v1_node_selector_requirement_free(listEntry->data); + listEntry->data = NULL; + } + list_freeList(match_fieldsList); + match_fieldsList = NULL; + } return NULL; } diff --git a/kubernetes/model/v1_node_spec.c b/kubernetes/model/v1_node_spec.c index 94aaaaaf..69479f4c 100644 --- a/kubernetes/model/v1_node_spec.c +++ b/kubernetes/model/v1_node_spec.c @@ -167,6 +167,12 @@ v1_node_spec_t *v1_node_spec_parseFromJSON(cJSON *v1_node_specJSON){ // define the local variable for v1_node_spec->config_source v1_node_config_source_t *config_source_local_nonprim = NULL; + // define the local list for v1_node_spec->pod_cidrs + list_t *pod_cidrsList = NULL; + + // define the local list for v1_node_spec->taints + list_t *taintsList = NULL; + // v1_node_spec->config_source cJSON *config_source = cJSON_GetObjectItemCaseSensitive(v1_node_specJSON, "configSource"); if (config_source) { @@ -193,9 +199,8 @@ v1_node_spec_t *v1_node_spec_parseFromJSON(cJSON *v1_node_specJSON){ // v1_node_spec->pod_cidrs cJSON *pod_cidrs = cJSON_GetObjectItemCaseSensitive(v1_node_specJSON, "podCIDRs"); - list_t *pod_cidrsList; if (pod_cidrs) { - cJSON *pod_cidrs_local; + cJSON *pod_cidrs_local = NULL; if(!cJSON_IsArray(pod_cidrs)) { goto end;//primitive container } @@ -222,9 +227,8 @@ v1_node_spec_t *v1_node_spec_parseFromJSON(cJSON *v1_node_specJSON){ // v1_node_spec->taints cJSON *taints = cJSON_GetObjectItemCaseSensitive(v1_node_specJSON, "taints"); - list_t *taintsList; if (taints) { - cJSON *taints_local_nonprimitive; + cJSON *taints_local_nonprimitive = NULL; if(!cJSON_IsArray(taints)){ goto end; //nonprimitive container } @@ -268,6 +272,24 @@ v1_node_spec_t *v1_node_spec_parseFromJSON(cJSON *v1_node_specJSON){ v1_node_config_source_free(config_source_local_nonprim); config_source_local_nonprim = NULL; } + if (pod_cidrsList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, pod_cidrsList) { + free(listEntry->data); + listEntry->data = NULL; + } + list_freeList(pod_cidrsList); + pod_cidrsList = NULL; + } + if (taintsList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, taintsList) { + v1_taint_free(listEntry->data); + listEntry->data = NULL; + } + list_freeList(taintsList); + taintsList = NULL; + } return NULL; } diff --git a/kubernetes/model/v1_node_status.c b/kubernetes/model/v1_node_status.c index be90f017..2601089c 100644 --- a/kubernetes/model/v1_node_status.c +++ b/kubernetes/model/v1_node_status.c @@ -315,20 +315,40 @@ v1_node_status_t *v1_node_status_parseFromJSON(cJSON *v1_node_statusJSON){ v1_node_status_t *v1_node_status_local_var = NULL; + // define the local list for v1_node_status->addresses + list_t *addressesList = NULL; + + // define the local map for v1_node_status->allocatable + list_t *allocatableList = NULL; + + // define the local map for v1_node_status->capacity + list_t *capacityList = NULL; + + // define the local list for v1_node_status->conditions + list_t *conditionsList = NULL; + // define the local variable for v1_node_status->config v1_node_config_status_t *config_local_nonprim = NULL; // define the local variable for v1_node_status->daemon_endpoints v1_node_daemon_endpoints_t *daemon_endpoints_local_nonprim = NULL; + // define the local list for v1_node_status->images + list_t *imagesList = NULL; + // define the local variable for v1_node_status->node_info v1_node_system_info_t *node_info_local_nonprim = NULL; + // define the local list for v1_node_status->volumes_attached + list_t *volumes_attachedList = NULL; + + // define the local list for v1_node_status->volumes_in_use + list_t *volumes_in_useList = NULL; + // v1_node_status->addresses cJSON *addresses = cJSON_GetObjectItemCaseSensitive(v1_node_statusJSON, "addresses"); - list_t *addressesList; if (addresses) { - cJSON *addresses_local_nonprimitive; + cJSON *addresses_local_nonprimitive = NULL; if(!cJSON_IsArray(addresses)){ goto end; //nonprimitive container } @@ -348,9 +368,8 @@ v1_node_status_t *v1_node_status_parseFromJSON(cJSON *v1_node_statusJSON){ // v1_node_status->allocatable cJSON *allocatable = cJSON_GetObjectItemCaseSensitive(v1_node_statusJSON, "allocatable"); - list_t *allocatableList; if (allocatable) { - cJSON *allocatable_local_map; + cJSON *allocatable_local_map = NULL; if(!cJSON_IsObject(allocatable)) { goto end;//primitive map container } @@ -370,9 +389,8 @@ v1_node_status_t *v1_node_status_parseFromJSON(cJSON *v1_node_statusJSON){ // v1_node_status->capacity cJSON *capacity = cJSON_GetObjectItemCaseSensitive(v1_node_statusJSON, "capacity"); - list_t *capacityList; if (capacity) { - cJSON *capacity_local_map; + cJSON *capacity_local_map = NULL; if(!cJSON_IsObject(capacity)) { goto end;//primitive map container } @@ -392,9 +410,8 @@ v1_node_status_t *v1_node_status_parseFromJSON(cJSON *v1_node_statusJSON){ // v1_node_status->conditions cJSON *conditions = cJSON_GetObjectItemCaseSensitive(v1_node_statusJSON, "conditions"); - list_t *conditionsList; if (conditions) { - cJSON *conditions_local_nonprimitive; + cJSON *conditions_local_nonprimitive = NULL; if(!cJSON_IsArray(conditions)){ goto end; //nonprimitive container } @@ -426,9 +443,8 @@ v1_node_status_t *v1_node_status_parseFromJSON(cJSON *v1_node_statusJSON){ // v1_node_status->images cJSON *images = cJSON_GetObjectItemCaseSensitive(v1_node_statusJSON, "images"); - list_t *imagesList; if (images) { - cJSON *images_local_nonprimitive; + cJSON *images_local_nonprimitive = NULL; if(!cJSON_IsArray(images)){ goto end; //nonprimitive container } @@ -463,9 +479,8 @@ v1_node_status_t *v1_node_status_parseFromJSON(cJSON *v1_node_statusJSON){ // v1_node_status->volumes_attached cJSON *volumes_attached = cJSON_GetObjectItemCaseSensitive(v1_node_statusJSON, "volumesAttached"); - list_t *volumes_attachedList; if (volumes_attached) { - cJSON *volumes_attached_local_nonprimitive; + cJSON *volumes_attached_local_nonprimitive = NULL; if(!cJSON_IsArray(volumes_attached)){ goto end; //nonprimitive container } @@ -485,9 +500,8 @@ v1_node_status_t *v1_node_status_parseFromJSON(cJSON *v1_node_statusJSON){ // v1_node_status->volumes_in_use cJSON *volumes_in_use = cJSON_GetObjectItemCaseSensitive(v1_node_statusJSON, "volumesInUse"); - list_t *volumes_in_useList; if (volumes_in_use) { - cJSON *volumes_in_use_local; + cJSON *volumes_in_use_local = NULL; if(!cJSON_IsArray(volumes_in_use)) { goto end;//primitive container } @@ -520,6 +534,52 @@ v1_node_status_t *v1_node_status_parseFromJSON(cJSON *v1_node_statusJSON){ return v1_node_status_local_var; end: + if (addressesList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, addressesList) { + v1_node_address_free(listEntry->data); + listEntry->data = NULL; + } + list_freeList(addressesList); + addressesList = NULL; + } + if (allocatableList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, allocatableList) { + keyValuePair_t *localKeyValue = (keyValuePair_t*) listEntry->data; + free(localKeyValue->key); + localKeyValue->key = NULL; + free(localKeyValue->value); + localKeyValue->value = NULL; + keyValuePair_free(localKeyValue); + localKeyValue = NULL; + } + list_freeList(allocatableList); + allocatableList = NULL; + } + if (capacityList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, capacityList) { + keyValuePair_t *localKeyValue = (keyValuePair_t*) listEntry->data; + free(localKeyValue->key); + localKeyValue->key = NULL; + free(localKeyValue->value); + localKeyValue->value = NULL; + keyValuePair_free(localKeyValue); + localKeyValue = NULL; + } + list_freeList(capacityList); + capacityList = NULL; + } + if (conditionsList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, conditionsList) { + v1_node_condition_free(listEntry->data); + listEntry->data = NULL; + } + list_freeList(conditionsList); + conditionsList = NULL; + } if (config_local_nonprim) { v1_node_config_status_free(config_local_nonprim); config_local_nonprim = NULL; @@ -528,10 +588,37 @@ v1_node_status_t *v1_node_status_parseFromJSON(cJSON *v1_node_statusJSON){ v1_node_daemon_endpoints_free(daemon_endpoints_local_nonprim); daemon_endpoints_local_nonprim = NULL; } + if (imagesList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, imagesList) { + v1_container_image_free(listEntry->data); + listEntry->data = NULL; + } + list_freeList(imagesList); + imagesList = NULL; + } if (node_info_local_nonprim) { v1_node_system_info_free(node_info_local_nonprim); node_info_local_nonprim = NULL; } + if (volumes_attachedList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, volumes_attachedList) { + v1_attached_volume_free(listEntry->data); + listEntry->data = NULL; + } + list_freeList(volumes_attachedList); + volumes_attachedList = NULL; + } + if (volumes_in_useList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, volumes_in_useList) { + free(listEntry->data); + listEntry->data = NULL; + } + list_freeList(volumes_in_useList); + volumes_in_useList = NULL; + } return NULL; } diff --git a/kubernetes/model/v1_non_resource_rule.c b/kubernetes/model/v1_non_resource_rule.c index 9f0178b9..201a62ad 100644 --- a/kubernetes/model/v1_non_resource_rule.c +++ b/kubernetes/model/v1_non_resource_rule.c @@ -92,11 +92,16 @@ v1_non_resource_rule_t *v1_non_resource_rule_parseFromJSON(cJSON *v1_non_resourc v1_non_resource_rule_t *v1_non_resource_rule_local_var = NULL; + // define the local list for v1_non_resource_rule->non_resource_urls + list_t *non_resource_urlsList = NULL; + + // define the local list for v1_non_resource_rule->verbs + list_t *verbsList = NULL; + // v1_non_resource_rule->non_resource_urls cJSON *non_resource_urls = cJSON_GetObjectItemCaseSensitive(v1_non_resource_ruleJSON, "nonResourceURLs"); - list_t *non_resource_urlsList; if (non_resource_urls) { - cJSON *non_resource_urls_local; + cJSON *non_resource_urls_local = NULL; if(!cJSON_IsArray(non_resource_urls)) { goto end;//primitive container } @@ -118,9 +123,8 @@ v1_non_resource_rule_t *v1_non_resource_rule_parseFromJSON(cJSON *v1_non_resourc goto end; } - list_t *verbsList; - cJSON *verbs_local; + cJSON *verbs_local = NULL; if(!cJSON_IsArray(verbs)) { goto end;//primitive container } @@ -143,6 +147,24 @@ v1_non_resource_rule_t *v1_non_resource_rule_parseFromJSON(cJSON *v1_non_resourc return v1_non_resource_rule_local_var; end: + if (non_resource_urlsList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, non_resource_urlsList) { + free(listEntry->data); + listEntry->data = NULL; + } + list_freeList(non_resource_urlsList); + non_resource_urlsList = NULL; + } + if (verbsList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, verbsList) { + free(listEntry->data); + listEntry->data = NULL; + } + list_freeList(verbsList); + verbsList = NULL; + } return NULL; } diff --git a/kubernetes/model/v1_object_meta.c b/kubernetes/model/v1_object_meta.c index 6ba3eb4d..72ff961b 100644 --- a/kubernetes/model/v1_object_meta.c +++ b/kubernetes/model/v1_object_meta.c @@ -332,11 +332,25 @@ v1_object_meta_t *v1_object_meta_parseFromJSON(cJSON *v1_object_metaJSON){ v1_object_meta_t *v1_object_meta_local_var = NULL; + // define the local map for v1_object_meta->annotations + list_t *annotationsList = NULL; + + // define the local list for v1_object_meta->finalizers + list_t *finalizersList = NULL; + + // define the local map for v1_object_meta->labels + list_t *labelsList = NULL; + + // define the local list for v1_object_meta->managed_fields + list_t *managed_fieldsList = NULL; + + // define the local list for v1_object_meta->owner_references + list_t *owner_referencesList = NULL; + // v1_object_meta->annotations cJSON *annotations = cJSON_GetObjectItemCaseSensitive(v1_object_metaJSON, "annotations"); - list_t *annotationsList; if (annotations) { - cJSON *annotations_local_map; + cJSON *annotations_local_map = NULL; if(!cJSON_IsObject(annotations)) { goto end;//primitive map container } @@ -392,9 +406,8 @@ v1_object_meta_t *v1_object_meta_parseFromJSON(cJSON *v1_object_metaJSON){ // v1_object_meta->finalizers cJSON *finalizers = cJSON_GetObjectItemCaseSensitive(v1_object_metaJSON, "finalizers"); - list_t *finalizersList; if (finalizers) { - cJSON *finalizers_local; + cJSON *finalizers_local = NULL; if(!cJSON_IsArray(finalizers)) { goto end;//primitive container } @@ -430,9 +443,8 @@ v1_object_meta_t *v1_object_meta_parseFromJSON(cJSON *v1_object_metaJSON){ // v1_object_meta->labels cJSON *labels = cJSON_GetObjectItemCaseSensitive(v1_object_metaJSON, "labels"); - list_t *labelsList; if (labels) { - cJSON *labels_local_map; + cJSON *labels_local_map = NULL; if(!cJSON_IsObject(labels)) { goto end;//primitive map container } @@ -452,9 +464,8 @@ v1_object_meta_t *v1_object_meta_parseFromJSON(cJSON *v1_object_metaJSON){ // v1_object_meta->managed_fields cJSON *managed_fields = cJSON_GetObjectItemCaseSensitive(v1_object_metaJSON, "managedFields"); - list_t *managed_fieldsList; if (managed_fields) { - cJSON *managed_fields_local_nonprimitive; + cJSON *managed_fields_local_nonprimitive = NULL; if(!cJSON_IsArray(managed_fields)){ goto end; //nonprimitive container } @@ -492,9 +503,8 @@ v1_object_meta_t *v1_object_meta_parseFromJSON(cJSON *v1_object_metaJSON){ // v1_object_meta->owner_references cJSON *owner_references = cJSON_GetObjectItemCaseSensitive(v1_object_metaJSON, "ownerReferences"); - list_t *owner_referencesList; if (owner_references) { - cJSON *owner_references_local_nonprimitive; + cJSON *owner_references_local_nonprimitive = NULL; if(!cJSON_IsArray(owner_references)){ goto end; //nonprimitive container } @@ -561,6 +571,61 @@ v1_object_meta_t *v1_object_meta_parseFromJSON(cJSON *v1_object_metaJSON){ return v1_object_meta_local_var; end: + if (annotationsList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, annotationsList) { + keyValuePair_t *localKeyValue = (keyValuePair_t*) listEntry->data; + free(localKeyValue->key); + localKeyValue->key = NULL; + free(localKeyValue->value); + localKeyValue->value = NULL; + keyValuePair_free(localKeyValue); + localKeyValue = NULL; + } + list_freeList(annotationsList); + annotationsList = NULL; + } + if (finalizersList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, finalizersList) { + free(listEntry->data); + listEntry->data = NULL; + } + list_freeList(finalizersList); + finalizersList = NULL; + } + if (labelsList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, labelsList) { + keyValuePair_t *localKeyValue = (keyValuePair_t*) listEntry->data; + free(localKeyValue->key); + localKeyValue->key = NULL; + free(localKeyValue->value); + localKeyValue->value = NULL; + keyValuePair_free(localKeyValue); + localKeyValue = NULL; + } + list_freeList(labelsList); + labelsList = NULL; + } + if (managed_fieldsList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, managed_fieldsList) { + v1_managed_fields_entry_free(listEntry->data); + listEntry->data = NULL; + } + list_freeList(managed_fieldsList); + managed_fieldsList = NULL; + } + if (owner_referencesList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, owner_referencesList) { + v1_owner_reference_free(listEntry->data); + listEntry->data = NULL; + } + list_freeList(owner_referencesList); + owner_referencesList = NULL; + } return NULL; } diff --git a/kubernetes/model/v1_overhead.c b/kubernetes/model/v1_overhead.c index 1ee21f41..9208fea5 100644 --- a/kubernetes/model/v1_overhead.c +++ b/kubernetes/model/v1_overhead.c @@ -70,11 +70,13 @@ v1_overhead_t *v1_overhead_parseFromJSON(cJSON *v1_overheadJSON){ v1_overhead_t *v1_overhead_local_var = NULL; + // define the local map for v1_overhead->pod_fixed + list_t *pod_fixedList = NULL; + // v1_overhead->pod_fixed cJSON *pod_fixed = cJSON_GetObjectItemCaseSensitive(v1_overheadJSON, "podFixed"); - list_t *pod_fixedList; if (pod_fixed) { - cJSON *pod_fixed_local_map; + cJSON *pod_fixed_local_map = NULL; if(!cJSON_IsObject(pod_fixed)) { goto end;//primitive map container } @@ -99,6 +101,20 @@ v1_overhead_t *v1_overhead_parseFromJSON(cJSON *v1_overheadJSON){ return v1_overhead_local_var; end: + if (pod_fixedList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, pod_fixedList) { + keyValuePair_t *localKeyValue = (keyValuePair_t*) listEntry->data; + free(localKeyValue->key); + localKeyValue->key = NULL; + free(localKeyValue->value); + localKeyValue->value = NULL; + keyValuePair_free(localKeyValue); + localKeyValue = NULL; + } + list_freeList(pod_fixedList); + pod_fixedList = NULL; + } return NULL; } diff --git a/kubernetes/model/v1_persistent_volume_claim_list.c b/kubernetes/model/v1_persistent_volume_claim_list.c index 16fb3c03..12b4e933 100644 --- a/kubernetes/model/v1_persistent_volume_claim_list.c +++ b/kubernetes/model/v1_persistent_volume_claim_list.c @@ -116,6 +116,9 @@ v1_persistent_volume_claim_list_t *v1_persistent_volume_claim_list_parseFromJSON v1_persistent_volume_claim_list_t *v1_persistent_volume_claim_list_local_var = NULL; + // define the local list for v1_persistent_volume_claim_list->items + list_t *itemsList = NULL; + // define the local variable for v1_persistent_volume_claim_list->metadata v1_list_meta_t *metadata_local_nonprim = NULL; @@ -134,9 +137,8 @@ v1_persistent_volume_claim_list_t *v1_persistent_volume_claim_list_parseFromJSON goto end; } - list_t *itemsList; - cJSON *items_local_nonprimitive; + cJSON *items_local_nonprimitive = NULL; if(!cJSON_IsArray(items)){ goto end; //nonprimitive container } @@ -178,6 +180,15 @@ v1_persistent_volume_claim_list_t *v1_persistent_volume_claim_list_parseFromJSON return v1_persistent_volume_claim_list_local_var; end: + if (itemsList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, itemsList) { + v1_persistent_volume_claim_free(listEntry->data); + listEntry->data = NULL; + } + list_freeList(itemsList); + itemsList = NULL; + } if (metadata_local_nonprim) { v1_list_meta_free(metadata_local_nonprim); metadata_local_nonprim = NULL; diff --git a/kubernetes/model/v1_persistent_volume_claim_spec.c b/kubernetes/model/v1_persistent_volume_claim_spec.c index 8b4ba589..020a69c5 100644 --- a/kubernetes/model/v1_persistent_volume_claim_spec.c +++ b/kubernetes/model/v1_persistent_volume_claim_spec.c @@ -182,6 +182,9 @@ v1_persistent_volume_claim_spec_t *v1_persistent_volume_claim_spec_parseFromJSON v1_persistent_volume_claim_spec_t *v1_persistent_volume_claim_spec_local_var = NULL; + // define the local list for v1_persistent_volume_claim_spec->access_modes + list_t *access_modesList = NULL; + // define the local variable for v1_persistent_volume_claim_spec->data_source v1_typed_local_object_reference_t *data_source_local_nonprim = NULL; @@ -196,9 +199,8 @@ v1_persistent_volume_claim_spec_t *v1_persistent_volume_claim_spec_parseFromJSON // v1_persistent_volume_claim_spec->access_modes cJSON *access_modes = cJSON_GetObjectItemCaseSensitive(v1_persistent_volume_claim_specJSON, "accessModes"); - list_t *access_modesList; if (access_modes) { - cJSON *access_modes_local; + cJSON *access_modes_local = NULL; if(!cJSON_IsArray(access_modes)) { goto end;//primitive container } @@ -279,6 +281,15 @@ v1_persistent_volume_claim_spec_t *v1_persistent_volume_claim_spec_parseFromJSON return v1_persistent_volume_claim_spec_local_var; end: + if (access_modesList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, access_modesList) { + free(listEntry->data); + listEntry->data = NULL; + } + list_freeList(access_modesList); + access_modesList = NULL; + } if (data_source_local_nonprim) { v1_typed_local_object_reference_free(data_source_local_nonprim); data_source_local_nonprim = NULL; diff --git a/kubernetes/model/v1_persistent_volume_claim_status.c b/kubernetes/model/v1_persistent_volume_claim_status.c index bd8e2ea1..30933240 100644 --- a/kubernetes/model/v1_persistent_volume_claim_status.c +++ b/kubernetes/model/v1_persistent_volume_claim_status.c @@ -139,11 +139,19 @@ v1_persistent_volume_claim_status_t *v1_persistent_volume_claim_status_parseFrom v1_persistent_volume_claim_status_t *v1_persistent_volume_claim_status_local_var = NULL; + // define the local list for v1_persistent_volume_claim_status->access_modes + list_t *access_modesList = NULL; + + // define the local map for v1_persistent_volume_claim_status->capacity + list_t *capacityList = NULL; + + // define the local list for v1_persistent_volume_claim_status->conditions + list_t *conditionsList = NULL; + // v1_persistent_volume_claim_status->access_modes cJSON *access_modes = cJSON_GetObjectItemCaseSensitive(v1_persistent_volume_claim_statusJSON, "accessModes"); - list_t *access_modesList; if (access_modes) { - cJSON *access_modes_local; + cJSON *access_modes_local = NULL; if(!cJSON_IsArray(access_modes)) { goto end;//primitive container } @@ -161,9 +169,8 @@ v1_persistent_volume_claim_status_t *v1_persistent_volume_claim_status_parseFrom // v1_persistent_volume_claim_status->capacity cJSON *capacity = cJSON_GetObjectItemCaseSensitive(v1_persistent_volume_claim_statusJSON, "capacity"); - list_t *capacityList; if (capacity) { - cJSON *capacity_local_map; + cJSON *capacity_local_map = NULL; if(!cJSON_IsObject(capacity)) { goto end;//primitive map container } @@ -183,9 +190,8 @@ v1_persistent_volume_claim_status_t *v1_persistent_volume_claim_status_parseFrom // v1_persistent_volume_claim_status->conditions cJSON *conditions = cJSON_GetObjectItemCaseSensitive(v1_persistent_volume_claim_statusJSON, "conditions"); - list_t *conditionsList; if (conditions) { - cJSON *conditions_local_nonprimitive; + cJSON *conditions_local_nonprimitive = NULL; if(!cJSON_IsArray(conditions)){ goto end; //nonprimitive container } @@ -222,6 +228,38 @@ v1_persistent_volume_claim_status_t *v1_persistent_volume_claim_status_parseFrom return v1_persistent_volume_claim_status_local_var; end: + if (access_modesList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, access_modesList) { + free(listEntry->data); + listEntry->data = NULL; + } + list_freeList(access_modesList); + access_modesList = NULL; + } + if (capacityList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, capacityList) { + keyValuePair_t *localKeyValue = (keyValuePair_t*) listEntry->data; + free(localKeyValue->key); + localKeyValue->key = NULL; + free(localKeyValue->value); + localKeyValue->value = NULL; + keyValuePair_free(localKeyValue); + localKeyValue = NULL; + } + list_freeList(capacityList); + capacityList = NULL; + } + if (conditionsList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, conditionsList) { + v1_persistent_volume_claim_condition_free(listEntry->data); + listEntry->data = NULL; + } + list_freeList(conditionsList); + conditionsList = NULL; + } return NULL; } diff --git a/kubernetes/model/v1_persistent_volume_list.c b/kubernetes/model/v1_persistent_volume_list.c index 21b6ba0d..3057516d 100644 --- a/kubernetes/model/v1_persistent_volume_list.c +++ b/kubernetes/model/v1_persistent_volume_list.c @@ -116,6 +116,9 @@ v1_persistent_volume_list_t *v1_persistent_volume_list_parseFromJSON(cJSON *v1_p v1_persistent_volume_list_t *v1_persistent_volume_list_local_var = NULL; + // define the local list for v1_persistent_volume_list->items + list_t *itemsList = NULL; + // define the local variable for v1_persistent_volume_list->metadata v1_list_meta_t *metadata_local_nonprim = NULL; @@ -134,9 +137,8 @@ v1_persistent_volume_list_t *v1_persistent_volume_list_parseFromJSON(cJSON *v1_p goto end; } - list_t *itemsList; - cJSON *items_local_nonprimitive; + cJSON *items_local_nonprimitive = NULL; if(!cJSON_IsArray(items)){ goto end; //nonprimitive container } @@ -178,6 +180,15 @@ v1_persistent_volume_list_t *v1_persistent_volume_list_parseFromJSON(cJSON *v1_p return v1_persistent_volume_list_local_var; end: + if (itemsList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, itemsList) { + v1_persistent_volume_free(listEntry->data); + listEntry->data = NULL; + } + list_freeList(itemsList); + itemsList = NULL; + } if (metadata_local_nonprim) { v1_list_meta_free(metadata_local_nonprim); metadata_local_nonprim = NULL; diff --git a/kubernetes/model/v1_persistent_volume_spec.c b/kubernetes/model/v1_persistent_volume_spec.c index f64e1407..3c548e46 100644 --- a/kubernetes/model/v1_persistent_volume_spec.c +++ b/kubernetes/model/v1_persistent_volume_spec.c @@ -620,6 +620,9 @@ v1_persistent_volume_spec_t *v1_persistent_volume_spec_parseFromJSON(cJSON *v1_p v1_persistent_volume_spec_t *v1_persistent_volume_spec_local_var = NULL; + // define the local list for v1_persistent_volume_spec->access_modes + list_t *access_modesList = NULL; + // define the local variable for v1_persistent_volume_spec->aws_elastic_block_store v1_aws_elastic_block_store_volume_source_t *aws_elastic_block_store_local_nonprim = NULL; @@ -629,6 +632,9 @@ v1_persistent_volume_spec_t *v1_persistent_volume_spec_parseFromJSON(cJSON *v1_p // define the local variable for v1_persistent_volume_spec->azure_file v1_azure_file_persistent_volume_source_t *azure_file_local_nonprim = NULL; + // define the local map for v1_persistent_volume_spec->capacity + list_t *capacityList = NULL; + // define the local variable for v1_persistent_volume_spec->cephfs v1_ceph_fs_persistent_volume_source_t *cephfs_local_nonprim = NULL; @@ -665,6 +671,9 @@ v1_persistent_volume_spec_t *v1_persistent_volume_spec_parseFromJSON(cJSON *v1_p // define the local variable for v1_persistent_volume_spec->local v1_local_volume_source_t *local_local_nonprim = NULL; + // define the local list for v1_persistent_volume_spec->mount_options + list_t *mount_optionsList = NULL; + // define the local variable for v1_persistent_volume_spec->nfs v1_nfs_volume_source_t *nfs_local_nonprim = NULL; @@ -694,9 +703,8 @@ v1_persistent_volume_spec_t *v1_persistent_volume_spec_parseFromJSON(cJSON *v1_p // v1_persistent_volume_spec->access_modes cJSON *access_modes = cJSON_GetObjectItemCaseSensitive(v1_persistent_volume_specJSON, "accessModes"); - list_t *access_modesList; if (access_modes) { - cJSON *access_modes_local; + cJSON *access_modes_local = NULL; if(!cJSON_IsArray(access_modes)) { goto end;//primitive container } @@ -732,9 +740,8 @@ v1_persistent_volume_spec_t *v1_persistent_volume_spec_parseFromJSON(cJSON *v1_p // v1_persistent_volume_spec->capacity cJSON *capacity = cJSON_GetObjectItemCaseSensitive(v1_persistent_volume_specJSON, "capacity"); - list_t *capacityList; if (capacity) { - cJSON *capacity_local_map; + cJSON *capacity_local_map = NULL; if(!cJSON_IsObject(capacity)) { goto end;//primitive map container } @@ -826,9 +833,8 @@ v1_persistent_volume_spec_t *v1_persistent_volume_spec_parseFromJSON(cJSON *v1_p // v1_persistent_volume_spec->mount_options cJSON *mount_options = cJSON_GetObjectItemCaseSensitive(v1_persistent_volume_specJSON, "mountOptions"); - list_t *mount_optionsList; if (mount_options) { - cJSON *mount_options_local; + cJSON *mount_options_local = NULL; if(!cJSON_IsArray(mount_options)) { goto end;//primitive container } @@ -961,6 +967,15 @@ v1_persistent_volume_spec_t *v1_persistent_volume_spec_parseFromJSON(cJSON *v1_p return v1_persistent_volume_spec_local_var; end: + if (access_modesList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, access_modesList) { + free(listEntry->data); + listEntry->data = NULL; + } + list_freeList(access_modesList); + access_modesList = NULL; + } if (aws_elastic_block_store_local_nonprim) { v1_aws_elastic_block_store_volume_source_free(aws_elastic_block_store_local_nonprim); aws_elastic_block_store_local_nonprim = NULL; @@ -973,6 +988,20 @@ v1_persistent_volume_spec_t *v1_persistent_volume_spec_parseFromJSON(cJSON *v1_p v1_azure_file_persistent_volume_source_free(azure_file_local_nonprim); azure_file_local_nonprim = NULL; } + if (capacityList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, capacityList) { + keyValuePair_t *localKeyValue = (keyValuePair_t*) listEntry->data; + free(localKeyValue->key); + localKeyValue->key = NULL; + free(localKeyValue->value); + localKeyValue->value = NULL; + keyValuePair_free(localKeyValue); + localKeyValue = NULL; + } + list_freeList(capacityList); + capacityList = NULL; + } if (cephfs_local_nonprim) { v1_ceph_fs_persistent_volume_source_free(cephfs_local_nonprim); cephfs_local_nonprim = NULL; @@ -1021,6 +1050,15 @@ v1_persistent_volume_spec_t *v1_persistent_volume_spec_parseFromJSON(cJSON *v1_p v1_local_volume_source_free(local_local_nonprim); local_local_nonprim = NULL; } + if (mount_optionsList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, mount_optionsList) { + free(listEntry->data); + listEntry->data = NULL; + } + list_freeList(mount_optionsList); + mount_optionsList = NULL; + } if (nfs_local_nonprim) { v1_nfs_volume_source_free(nfs_local_nonprim); nfs_local_nonprim = NULL; diff --git a/kubernetes/model/v1_pod_affinity.c b/kubernetes/model/v1_pod_affinity.c index 37737890..03c92922 100644 --- a/kubernetes/model/v1_pod_affinity.c +++ b/kubernetes/model/v1_pod_affinity.c @@ -96,11 +96,16 @@ v1_pod_affinity_t *v1_pod_affinity_parseFromJSON(cJSON *v1_pod_affinityJSON){ v1_pod_affinity_t *v1_pod_affinity_local_var = NULL; + // define the local list for v1_pod_affinity->preferred_during_scheduling_ignored_during_execution + list_t *preferred_during_scheduling_ignored_during_executionList = NULL; + + // define the local list for v1_pod_affinity->required_during_scheduling_ignored_during_execution + list_t *required_during_scheduling_ignored_during_executionList = NULL; + // v1_pod_affinity->preferred_during_scheduling_ignored_during_execution cJSON *preferred_during_scheduling_ignored_during_execution = cJSON_GetObjectItemCaseSensitive(v1_pod_affinityJSON, "preferredDuringSchedulingIgnoredDuringExecution"); - list_t *preferred_during_scheduling_ignored_during_executionList; if (preferred_during_scheduling_ignored_during_execution) { - cJSON *preferred_during_scheduling_ignored_during_execution_local_nonprimitive; + cJSON *preferred_during_scheduling_ignored_during_execution_local_nonprimitive = NULL; if(!cJSON_IsArray(preferred_during_scheduling_ignored_during_execution)){ goto end; //nonprimitive container } @@ -120,9 +125,8 @@ v1_pod_affinity_t *v1_pod_affinity_parseFromJSON(cJSON *v1_pod_affinityJSON){ // v1_pod_affinity->required_during_scheduling_ignored_during_execution cJSON *required_during_scheduling_ignored_during_execution = cJSON_GetObjectItemCaseSensitive(v1_pod_affinityJSON, "requiredDuringSchedulingIgnoredDuringExecution"); - list_t *required_during_scheduling_ignored_during_executionList; if (required_during_scheduling_ignored_during_execution) { - cJSON *required_during_scheduling_ignored_during_execution_local_nonprimitive; + cJSON *required_during_scheduling_ignored_during_execution_local_nonprimitive = NULL; if(!cJSON_IsArray(required_during_scheduling_ignored_during_execution)){ goto end; //nonprimitive container } @@ -148,6 +152,24 @@ v1_pod_affinity_t *v1_pod_affinity_parseFromJSON(cJSON *v1_pod_affinityJSON){ return v1_pod_affinity_local_var; end: + if (preferred_during_scheduling_ignored_during_executionList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, preferred_during_scheduling_ignored_during_executionList) { + v1_weighted_pod_affinity_term_free(listEntry->data); + listEntry->data = NULL; + } + list_freeList(preferred_during_scheduling_ignored_during_executionList); + preferred_during_scheduling_ignored_during_executionList = NULL; + } + if (required_during_scheduling_ignored_during_executionList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, required_during_scheduling_ignored_during_executionList) { + v1_pod_affinity_term_free(listEntry->data); + listEntry->data = NULL; + } + list_freeList(required_during_scheduling_ignored_during_executionList); + required_during_scheduling_ignored_during_executionList = NULL; + } return NULL; } diff --git a/kubernetes/model/v1_pod_affinity_term.c b/kubernetes/model/v1_pod_affinity_term.c index 491736d1..c5a5c513 100644 --- a/kubernetes/model/v1_pod_affinity_term.c +++ b/kubernetes/model/v1_pod_affinity_term.c @@ -124,6 +124,9 @@ v1_pod_affinity_term_t *v1_pod_affinity_term_parseFromJSON(cJSON *v1_pod_affinit // define the local variable for v1_pod_affinity_term->namespace_selector v1_label_selector_t *namespace_selector_local_nonprim = NULL; + // define the local list for v1_pod_affinity_term->namespaces + list_t *namespacesList = NULL; + // v1_pod_affinity_term->label_selector cJSON *label_selector = cJSON_GetObjectItemCaseSensitive(v1_pod_affinity_termJSON, "labelSelector"); if (label_selector) { @@ -138,9 +141,8 @@ v1_pod_affinity_term_t *v1_pod_affinity_term_parseFromJSON(cJSON *v1_pod_affinit // v1_pod_affinity_term->namespaces cJSON *namespaces = cJSON_GetObjectItemCaseSensitive(v1_pod_affinity_termJSON, "namespaces"); - list_t *namespacesList; if (namespaces) { - cJSON *namespaces_local; + cJSON *namespaces_local = NULL; if(!cJSON_IsArray(namespaces)) { goto end;//primitive container } @@ -186,6 +188,15 @@ v1_pod_affinity_term_t *v1_pod_affinity_term_parseFromJSON(cJSON *v1_pod_affinit v1_label_selector_free(namespace_selector_local_nonprim); namespace_selector_local_nonprim = NULL; } + if (namespacesList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, namespacesList) { + free(listEntry->data); + listEntry->data = NULL; + } + list_freeList(namespacesList); + namespacesList = NULL; + } return NULL; } diff --git a/kubernetes/model/v1_pod_anti_affinity.c b/kubernetes/model/v1_pod_anti_affinity.c index b59a11c4..0d41a46d 100644 --- a/kubernetes/model/v1_pod_anti_affinity.c +++ b/kubernetes/model/v1_pod_anti_affinity.c @@ -96,11 +96,16 @@ v1_pod_anti_affinity_t *v1_pod_anti_affinity_parseFromJSON(cJSON *v1_pod_anti_af v1_pod_anti_affinity_t *v1_pod_anti_affinity_local_var = NULL; + // define the local list for v1_pod_anti_affinity->preferred_during_scheduling_ignored_during_execution + list_t *preferred_during_scheduling_ignored_during_executionList = NULL; + + // define the local list for v1_pod_anti_affinity->required_during_scheduling_ignored_during_execution + list_t *required_during_scheduling_ignored_during_executionList = NULL; + // v1_pod_anti_affinity->preferred_during_scheduling_ignored_during_execution cJSON *preferred_during_scheduling_ignored_during_execution = cJSON_GetObjectItemCaseSensitive(v1_pod_anti_affinityJSON, "preferredDuringSchedulingIgnoredDuringExecution"); - list_t *preferred_during_scheduling_ignored_during_executionList; if (preferred_during_scheduling_ignored_during_execution) { - cJSON *preferred_during_scheduling_ignored_during_execution_local_nonprimitive; + cJSON *preferred_during_scheduling_ignored_during_execution_local_nonprimitive = NULL; if(!cJSON_IsArray(preferred_during_scheduling_ignored_during_execution)){ goto end; //nonprimitive container } @@ -120,9 +125,8 @@ v1_pod_anti_affinity_t *v1_pod_anti_affinity_parseFromJSON(cJSON *v1_pod_anti_af // v1_pod_anti_affinity->required_during_scheduling_ignored_during_execution cJSON *required_during_scheduling_ignored_during_execution = cJSON_GetObjectItemCaseSensitive(v1_pod_anti_affinityJSON, "requiredDuringSchedulingIgnoredDuringExecution"); - list_t *required_during_scheduling_ignored_during_executionList; if (required_during_scheduling_ignored_during_execution) { - cJSON *required_during_scheduling_ignored_during_execution_local_nonprimitive; + cJSON *required_during_scheduling_ignored_during_execution_local_nonprimitive = NULL; if(!cJSON_IsArray(required_during_scheduling_ignored_during_execution)){ goto end; //nonprimitive container } @@ -148,6 +152,24 @@ v1_pod_anti_affinity_t *v1_pod_anti_affinity_parseFromJSON(cJSON *v1_pod_anti_af return v1_pod_anti_affinity_local_var; end: + if (preferred_during_scheduling_ignored_during_executionList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, preferred_during_scheduling_ignored_during_executionList) { + v1_weighted_pod_affinity_term_free(listEntry->data); + listEntry->data = NULL; + } + list_freeList(preferred_during_scheduling_ignored_during_executionList); + preferred_during_scheduling_ignored_during_executionList = NULL; + } + if (required_during_scheduling_ignored_during_executionList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, required_during_scheduling_ignored_during_executionList) { + v1_pod_affinity_term_free(listEntry->data); + listEntry->data = NULL; + } + list_freeList(required_during_scheduling_ignored_during_executionList); + required_during_scheduling_ignored_during_executionList = NULL; + } return NULL; } diff --git a/kubernetes/model/v1_pod_disruption_budget_list.c b/kubernetes/model/v1_pod_disruption_budget_list.c index 83e344d5..5f7b1d88 100644 --- a/kubernetes/model/v1_pod_disruption_budget_list.c +++ b/kubernetes/model/v1_pod_disruption_budget_list.c @@ -116,6 +116,9 @@ v1_pod_disruption_budget_list_t *v1_pod_disruption_budget_list_parseFromJSON(cJS v1_pod_disruption_budget_list_t *v1_pod_disruption_budget_list_local_var = NULL; + // define the local list for v1_pod_disruption_budget_list->items + list_t *itemsList = NULL; + // define the local variable for v1_pod_disruption_budget_list->metadata v1_list_meta_t *metadata_local_nonprim = NULL; @@ -134,9 +137,8 @@ v1_pod_disruption_budget_list_t *v1_pod_disruption_budget_list_parseFromJSON(cJS goto end; } - list_t *itemsList; - cJSON *items_local_nonprimitive; + cJSON *items_local_nonprimitive = NULL; if(!cJSON_IsArray(items)){ goto end; //nonprimitive container } @@ -178,6 +180,15 @@ v1_pod_disruption_budget_list_t *v1_pod_disruption_budget_list_parseFromJSON(cJS return v1_pod_disruption_budget_list_local_var; end: + if (itemsList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, itemsList) { + v1_pod_disruption_budget_free(listEntry->data); + listEntry->data = NULL; + } + list_freeList(itemsList); + itemsList = NULL; + } if (metadata_local_nonprim) { v1_list_meta_free(metadata_local_nonprim); metadata_local_nonprim = NULL; diff --git a/kubernetes/model/v1_pod_disruption_budget_status.c b/kubernetes/model/v1_pod_disruption_budget_status.c index 870c71ed..8a12387e 100644 --- a/kubernetes/model/v1_pod_disruption_budget_status.c +++ b/kubernetes/model/v1_pod_disruption_budget_status.c @@ -153,11 +153,16 @@ v1_pod_disruption_budget_status_t *v1_pod_disruption_budget_status_parseFromJSON v1_pod_disruption_budget_status_t *v1_pod_disruption_budget_status_local_var = NULL; + // define the local list for v1_pod_disruption_budget_status->conditions + list_t *conditionsList = NULL; + + // define the local map for v1_pod_disruption_budget_status->disrupted_pods + list_t *disrupted_podsList = NULL; + // v1_pod_disruption_budget_status->conditions cJSON *conditions = cJSON_GetObjectItemCaseSensitive(v1_pod_disruption_budget_statusJSON, "conditions"); - list_t *conditionsList; if (conditions) { - cJSON *conditions_local_nonprimitive; + cJSON *conditions_local_nonprimitive = NULL; if(!cJSON_IsArray(conditions)){ goto end; //nonprimitive container } @@ -201,9 +206,8 @@ v1_pod_disruption_budget_status_t *v1_pod_disruption_budget_status_parseFromJSON // v1_pod_disruption_budget_status->disrupted_pods cJSON *disrupted_pods = cJSON_GetObjectItemCaseSensitive(v1_pod_disruption_budget_statusJSON, "disruptedPods"); - list_t *disrupted_podsList; if (disrupted_pods) { - cJSON *disrupted_pods_local_map; + cJSON *disrupted_pods_local_map = NULL; if(!cJSON_IsObject(disrupted_pods)) { goto end;//primitive map container } @@ -262,6 +266,27 @@ v1_pod_disruption_budget_status_t *v1_pod_disruption_budget_status_parseFromJSON return v1_pod_disruption_budget_status_local_var; end: + if (conditionsList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, conditionsList) { + v1_condition_free(listEntry->data); + listEntry->data = NULL; + } + list_freeList(conditionsList); + conditionsList = NULL; + } + if (disrupted_podsList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, disrupted_podsList) { + keyValuePair_t *localKeyValue = (keyValuePair_t*) listEntry->data; + free(localKeyValue->key); + localKeyValue->key = NULL; + keyValuePair_free(localKeyValue); + localKeyValue = NULL; + } + list_freeList(disrupted_podsList); + disrupted_podsList = NULL; + } return NULL; } diff --git a/kubernetes/model/v1_pod_dns_config.c b/kubernetes/model/v1_pod_dns_config.c index 5447f872..f686f36a 100644 --- a/kubernetes/model/v1_pod_dns_config.c +++ b/kubernetes/model/v1_pod_dns_config.c @@ -119,11 +119,19 @@ v1_pod_dns_config_t *v1_pod_dns_config_parseFromJSON(cJSON *v1_pod_dns_configJSO v1_pod_dns_config_t *v1_pod_dns_config_local_var = NULL; + // define the local list for v1_pod_dns_config->nameservers + list_t *nameserversList = NULL; + + // define the local list for v1_pod_dns_config->options + list_t *optionsList = NULL; + + // define the local list for v1_pod_dns_config->searches + list_t *searchesList = NULL; + // v1_pod_dns_config->nameservers cJSON *nameservers = cJSON_GetObjectItemCaseSensitive(v1_pod_dns_configJSON, "nameservers"); - list_t *nameserversList; if (nameservers) { - cJSON *nameservers_local; + cJSON *nameservers_local = NULL; if(!cJSON_IsArray(nameservers)) { goto end;//primitive container } @@ -141,9 +149,8 @@ v1_pod_dns_config_t *v1_pod_dns_config_parseFromJSON(cJSON *v1_pod_dns_configJSO // v1_pod_dns_config->options cJSON *options = cJSON_GetObjectItemCaseSensitive(v1_pod_dns_configJSON, "options"); - list_t *optionsList; if (options) { - cJSON *options_local_nonprimitive; + cJSON *options_local_nonprimitive = NULL; if(!cJSON_IsArray(options)){ goto end; //nonprimitive container } @@ -163,9 +170,8 @@ v1_pod_dns_config_t *v1_pod_dns_config_parseFromJSON(cJSON *v1_pod_dns_configJSO // v1_pod_dns_config->searches cJSON *searches = cJSON_GetObjectItemCaseSensitive(v1_pod_dns_configJSON, "searches"); - list_t *searchesList; if (searches) { - cJSON *searches_local; + cJSON *searches_local = NULL; if(!cJSON_IsArray(searches)) { goto end;//primitive container } @@ -190,6 +196,33 @@ v1_pod_dns_config_t *v1_pod_dns_config_parseFromJSON(cJSON *v1_pod_dns_configJSO return v1_pod_dns_config_local_var; end: + if (nameserversList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, nameserversList) { + free(listEntry->data); + listEntry->data = NULL; + } + list_freeList(nameserversList); + nameserversList = NULL; + } + if (optionsList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, optionsList) { + v1_pod_dns_config_option_free(listEntry->data); + listEntry->data = NULL; + } + list_freeList(optionsList); + optionsList = NULL; + } + if (searchesList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, searchesList) { + free(listEntry->data); + listEntry->data = NULL; + } + list_freeList(searchesList); + searchesList = NULL; + } return NULL; } diff --git a/kubernetes/model/v1_pod_list.c b/kubernetes/model/v1_pod_list.c index 3649b8a6..17ea9f69 100644 --- a/kubernetes/model/v1_pod_list.c +++ b/kubernetes/model/v1_pod_list.c @@ -116,6 +116,9 @@ v1_pod_list_t *v1_pod_list_parseFromJSON(cJSON *v1_pod_listJSON){ v1_pod_list_t *v1_pod_list_local_var = NULL; + // define the local list for v1_pod_list->items + list_t *itemsList = NULL; + // define the local variable for v1_pod_list->metadata v1_list_meta_t *metadata_local_nonprim = NULL; @@ -134,9 +137,8 @@ v1_pod_list_t *v1_pod_list_parseFromJSON(cJSON *v1_pod_listJSON){ goto end; } - list_t *itemsList; - cJSON *items_local_nonprimitive; + cJSON *items_local_nonprimitive = NULL; if(!cJSON_IsArray(items)){ goto end; //nonprimitive container } @@ -178,6 +180,15 @@ v1_pod_list_t *v1_pod_list_parseFromJSON(cJSON *v1_pod_listJSON){ return v1_pod_list_local_var; end: + if (itemsList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, itemsList) { + v1_pod_free(listEntry->data); + listEntry->data = NULL; + } + list_freeList(itemsList); + itemsList = NULL; + } if (metadata_local_nonprim) { v1_list_meta_free(metadata_local_nonprim); metadata_local_nonprim = NULL; diff --git a/kubernetes/model/v1_pod_security_context.c b/kubernetes/model/v1_pod_security_context.c index e0bda044..d249ca88 100644 --- a/kubernetes/model/v1_pod_security_context.c +++ b/kubernetes/model/v1_pod_security_context.c @@ -210,6 +210,12 @@ v1_pod_security_context_t *v1_pod_security_context_parseFromJSON(cJSON *v1_pod_s // define the local variable for v1_pod_security_context->seccomp_profile v1_seccomp_profile_t *seccomp_profile_local_nonprim = NULL; + // define the local list for v1_pod_security_context->supplemental_groups + list_t *supplemental_groupsList = NULL; + + // define the local list for v1_pod_security_context->sysctls + list_t *sysctlsList = NULL; + // define the local variable for v1_pod_security_context->windows_options v1_windows_security_context_options_t *windows_options_local_nonprim = NULL; @@ -272,9 +278,8 @@ v1_pod_security_context_t *v1_pod_security_context_parseFromJSON(cJSON *v1_pod_s // v1_pod_security_context->supplemental_groups cJSON *supplemental_groups = cJSON_GetObjectItemCaseSensitive(v1_pod_security_contextJSON, "supplementalGroups"); - list_t *supplemental_groupsList; if (supplemental_groups) { - cJSON *supplemental_groups_local; + cJSON *supplemental_groups_local = NULL; if(!cJSON_IsArray(supplemental_groups)) { goto end;//primitive container } @@ -298,9 +303,8 @@ v1_pod_security_context_t *v1_pod_security_context_parseFromJSON(cJSON *v1_pod_s // v1_pod_security_context->sysctls cJSON *sysctls = cJSON_GetObjectItemCaseSensitive(v1_pod_security_contextJSON, "sysctls"); - list_t *sysctlsList; if (sysctls) { - cJSON *sysctls_local_nonprimitive; + cJSON *sysctls_local_nonprimitive = NULL; if(!cJSON_IsArray(sysctls)){ goto end; //nonprimitive container } @@ -348,6 +352,24 @@ v1_pod_security_context_t *v1_pod_security_context_parseFromJSON(cJSON *v1_pod_s v1_seccomp_profile_free(seccomp_profile_local_nonprim); seccomp_profile_local_nonprim = NULL; } + if (supplemental_groupsList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, supplemental_groupsList) { + free(listEntry->data); + listEntry->data = NULL; + } + list_freeList(supplemental_groupsList); + supplemental_groupsList = NULL; + } + if (sysctlsList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, sysctlsList) { + v1_sysctl_free(listEntry->data); + listEntry->data = NULL; + } + list_freeList(sysctlsList); + sysctlsList = NULL; + } if (windows_options_local_nonprim) { v1_windows_security_context_options_free(windows_options_local_nonprim); windows_options_local_nonprim = NULL; diff --git a/kubernetes/model/v1_pod_spec.c b/kubernetes/model/v1_pod_spec.c index 134001df..980c98b5 100644 --- a/kubernetes/model/v1_pod_spec.c +++ b/kubernetes/model/v1_pod_spec.c @@ -679,12 +679,45 @@ v1_pod_spec_t *v1_pod_spec_parseFromJSON(cJSON *v1_pod_specJSON){ // define the local variable for v1_pod_spec->affinity v1_affinity_t *affinity_local_nonprim = NULL; + // define the local list for v1_pod_spec->containers + list_t *containersList = NULL; + // define the local variable for v1_pod_spec->dns_config v1_pod_dns_config_t *dns_config_local_nonprim = NULL; + // define the local list for v1_pod_spec->ephemeral_containers + list_t *ephemeral_containersList = NULL; + + // define the local list for v1_pod_spec->host_aliases + list_t *host_aliasesList = NULL; + + // define the local list for v1_pod_spec->image_pull_secrets + list_t *image_pull_secretsList = NULL; + + // define the local list for v1_pod_spec->init_containers + list_t *init_containersList = NULL; + + // define the local map for v1_pod_spec->node_selector + list_t *node_selectorList = NULL; + + // define the local map for v1_pod_spec->overhead + list_t *overheadList = NULL; + + // define the local list for v1_pod_spec->readiness_gates + list_t *readiness_gatesList = NULL; + // define the local variable for v1_pod_spec->security_context v1_pod_security_context_t *security_context_local_nonprim = NULL; + // define the local list for v1_pod_spec->tolerations + list_t *tolerationsList = NULL; + + // define the local list for v1_pod_spec->topology_spread_constraints + list_t *topology_spread_constraintsList = NULL; + + // define the local list for v1_pod_spec->volumes + list_t *volumesList = NULL; + // v1_pod_spec->active_deadline_seconds cJSON *active_deadline_seconds = cJSON_GetObjectItemCaseSensitive(v1_pod_specJSON, "activeDeadlineSeconds"); if (active_deadline_seconds) { @@ -715,9 +748,8 @@ v1_pod_spec_t *v1_pod_spec_parseFromJSON(cJSON *v1_pod_specJSON){ goto end; } - list_t *containersList; - cJSON *containers_local_nonprimitive; + cJSON *containers_local_nonprimitive = NULL; if(!cJSON_IsArray(containers)){ goto end; //nonprimitive container } @@ -760,9 +792,8 @@ v1_pod_spec_t *v1_pod_spec_parseFromJSON(cJSON *v1_pod_specJSON){ // v1_pod_spec->ephemeral_containers cJSON *ephemeral_containers = cJSON_GetObjectItemCaseSensitive(v1_pod_specJSON, "ephemeralContainers"); - list_t *ephemeral_containersList; if (ephemeral_containers) { - cJSON *ephemeral_containers_local_nonprimitive; + cJSON *ephemeral_containers_local_nonprimitive = NULL; if(!cJSON_IsArray(ephemeral_containers)){ goto end; //nonprimitive container } @@ -782,9 +813,8 @@ v1_pod_spec_t *v1_pod_spec_parseFromJSON(cJSON *v1_pod_specJSON){ // v1_pod_spec->host_aliases cJSON *host_aliases = cJSON_GetObjectItemCaseSensitive(v1_pod_specJSON, "hostAliases"); - list_t *host_aliasesList; if (host_aliases) { - cJSON *host_aliases_local_nonprimitive; + cJSON *host_aliases_local_nonprimitive = NULL; if(!cJSON_IsArray(host_aliases)){ goto end; //nonprimitive container } @@ -840,9 +870,8 @@ v1_pod_spec_t *v1_pod_spec_parseFromJSON(cJSON *v1_pod_specJSON){ // v1_pod_spec->image_pull_secrets cJSON *image_pull_secrets = cJSON_GetObjectItemCaseSensitive(v1_pod_specJSON, "imagePullSecrets"); - list_t *image_pull_secretsList; if (image_pull_secrets) { - cJSON *image_pull_secrets_local_nonprimitive; + cJSON *image_pull_secrets_local_nonprimitive = NULL; if(!cJSON_IsArray(image_pull_secrets)){ goto end; //nonprimitive container } @@ -862,9 +891,8 @@ v1_pod_spec_t *v1_pod_spec_parseFromJSON(cJSON *v1_pod_specJSON){ // v1_pod_spec->init_containers cJSON *init_containers = cJSON_GetObjectItemCaseSensitive(v1_pod_specJSON, "initContainers"); - list_t *init_containersList; if (init_containers) { - cJSON *init_containers_local_nonprimitive; + cJSON *init_containers_local_nonprimitive = NULL; if(!cJSON_IsArray(init_containers)){ goto end; //nonprimitive container } @@ -893,9 +921,8 @@ v1_pod_spec_t *v1_pod_spec_parseFromJSON(cJSON *v1_pod_specJSON){ // v1_pod_spec->node_selector cJSON *node_selector = cJSON_GetObjectItemCaseSensitive(v1_pod_specJSON, "nodeSelector"); - list_t *node_selectorList; if (node_selector) { - cJSON *node_selector_local_map; + cJSON *node_selector_local_map = NULL; if(!cJSON_IsObject(node_selector)) { goto end;//primitive map container } @@ -915,9 +942,8 @@ v1_pod_spec_t *v1_pod_spec_parseFromJSON(cJSON *v1_pod_specJSON){ // v1_pod_spec->overhead cJSON *overhead = cJSON_GetObjectItemCaseSensitive(v1_pod_specJSON, "overhead"); - list_t *overheadList; if (overhead) { - cJSON *overhead_local_map; + cJSON *overhead_local_map = NULL; if(!cJSON_IsObject(overhead)) { goto end;//primitive map container } @@ -964,9 +990,8 @@ v1_pod_spec_t *v1_pod_spec_parseFromJSON(cJSON *v1_pod_specJSON){ // v1_pod_spec->readiness_gates cJSON *readiness_gates = cJSON_GetObjectItemCaseSensitive(v1_pod_specJSON, "readinessGates"); - list_t *readiness_gatesList; if (readiness_gates) { - cJSON *readiness_gates_local_nonprimitive; + cJSON *readiness_gates_local_nonprimitive = NULL; if(!cJSON_IsArray(readiness_gates)){ goto end; //nonprimitive container } @@ -1073,9 +1098,8 @@ v1_pod_spec_t *v1_pod_spec_parseFromJSON(cJSON *v1_pod_specJSON){ // v1_pod_spec->tolerations cJSON *tolerations = cJSON_GetObjectItemCaseSensitive(v1_pod_specJSON, "tolerations"); - list_t *tolerationsList; if (tolerations) { - cJSON *tolerations_local_nonprimitive; + cJSON *tolerations_local_nonprimitive = NULL; if(!cJSON_IsArray(tolerations)){ goto end; //nonprimitive container } @@ -1095,9 +1119,8 @@ v1_pod_spec_t *v1_pod_spec_parseFromJSON(cJSON *v1_pod_specJSON){ // v1_pod_spec->topology_spread_constraints cJSON *topology_spread_constraints = cJSON_GetObjectItemCaseSensitive(v1_pod_specJSON, "topologySpreadConstraints"); - list_t *topology_spread_constraintsList; if (topology_spread_constraints) { - cJSON *topology_spread_constraints_local_nonprimitive; + cJSON *topology_spread_constraints_local_nonprimitive = NULL; if(!cJSON_IsArray(topology_spread_constraints)){ goto end; //nonprimitive container } @@ -1117,9 +1140,8 @@ v1_pod_spec_t *v1_pod_spec_parseFromJSON(cJSON *v1_pod_specJSON){ // v1_pod_spec->volumes cJSON *volumes = cJSON_GetObjectItemCaseSensitive(v1_pod_specJSON, "volumes"); - list_t *volumesList; if (volumes) { - cJSON *volumes_local_nonprimitive; + cJSON *volumes_local_nonprimitive = NULL; if(!cJSON_IsArray(volumes)){ goto end; //nonprimitive container } @@ -1182,14 +1204,123 @@ v1_pod_spec_t *v1_pod_spec_parseFromJSON(cJSON *v1_pod_specJSON){ v1_affinity_free(affinity_local_nonprim); affinity_local_nonprim = NULL; } + if (containersList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, containersList) { + v1_container_free(listEntry->data); + listEntry->data = NULL; + } + list_freeList(containersList); + containersList = NULL; + } if (dns_config_local_nonprim) { v1_pod_dns_config_free(dns_config_local_nonprim); dns_config_local_nonprim = NULL; } + if (ephemeral_containersList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, ephemeral_containersList) { + v1_ephemeral_container_free(listEntry->data); + listEntry->data = NULL; + } + list_freeList(ephemeral_containersList); + ephemeral_containersList = NULL; + } + if (host_aliasesList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, host_aliasesList) { + v1_host_alias_free(listEntry->data); + listEntry->data = NULL; + } + list_freeList(host_aliasesList); + host_aliasesList = NULL; + } + if (image_pull_secretsList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, image_pull_secretsList) { + v1_local_object_reference_free(listEntry->data); + listEntry->data = NULL; + } + list_freeList(image_pull_secretsList); + image_pull_secretsList = NULL; + } + if (init_containersList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, init_containersList) { + v1_container_free(listEntry->data); + listEntry->data = NULL; + } + list_freeList(init_containersList); + init_containersList = NULL; + } + if (node_selectorList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, node_selectorList) { + keyValuePair_t *localKeyValue = (keyValuePair_t*) listEntry->data; + free(localKeyValue->key); + localKeyValue->key = NULL; + free(localKeyValue->value); + localKeyValue->value = NULL; + keyValuePair_free(localKeyValue); + localKeyValue = NULL; + } + list_freeList(node_selectorList); + node_selectorList = NULL; + } + if (overheadList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, overheadList) { + keyValuePair_t *localKeyValue = (keyValuePair_t*) listEntry->data; + free(localKeyValue->key); + localKeyValue->key = NULL; + free(localKeyValue->value); + localKeyValue->value = NULL; + keyValuePair_free(localKeyValue); + localKeyValue = NULL; + } + list_freeList(overheadList); + overheadList = NULL; + } + if (readiness_gatesList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, readiness_gatesList) { + v1_pod_readiness_gate_free(listEntry->data); + listEntry->data = NULL; + } + list_freeList(readiness_gatesList); + readiness_gatesList = NULL; + } if (security_context_local_nonprim) { v1_pod_security_context_free(security_context_local_nonprim); security_context_local_nonprim = NULL; } + if (tolerationsList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, tolerationsList) { + v1_toleration_free(listEntry->data); + listEntry->data = NULL; + } + list_freeList(tolerationsList); + tolerationsList = NULL; + } + if (topology_spread_constraintsList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, topology_spread_constraintsList) { + v1_topology_spread_constraint_free(listEntry->data); + listEntry->data = NULL; + } + list_freeList(topology_spread_constraintsList); + topology_spread_constraintsList = NULL; + } + if (volumesList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, volumesList) { + v1_volume_free(listEntry->data); + listEntry->data = NULL; + } + list_freeList(volumesList); + volumesList = NULL; + } return NULL; } diff --git a/kubernetes/model/v1_pod_status.c b/kubernetes/model/v1_pod_status.c index 421a4e9c..7e6f373a 100644 --- a/kubernetes/model/v1_pod_status.c +++ b/kubernetes/model/v1_pod_status.c @@ -295,11 +295,25 @@ v1_pod_status_t *v1_pod_status_parseFromJSON(cJSON *v1_pod_statusJSON){ v1_pod_status_t *v1_pod_status_local_var = NULL; + // define the local list for v1_pod_status->conditions + list_t *conditionsList = NULL; + + // define the local list for v1_pod_status->container_statuses + list_t *container_statusesList = NULL; + + // define the local list for v1_pod_status->ephemeral_container_statuses + list_t *ephemeral_container_statusesList = NULL; + + // define the local list for v1_pod_status->init_container_statuses + list_t *init_container_statusesList = NULL; + + // define the local list for v1_pod_status->pod_ips + list_t *pod_ipsList = NULL; + // v1_pod_status->conditions cJSON *conditions = cJSON_GetObjectItemCaseSensitive(v1_pod_statusJSON, "conditions"); - list_t *conditionsList; if (conditions) { - cJSON *conditions_local_nonprimitive; + cJSON *conditions_local_nonprimitive = NULL; if(!cJSON_IsArray(conditions)){ goto end; //nonprimitive container } @@ -319,9 +333,8 @@ v1_pod_status_t *v1_pod_status_parseFromJSON(cJSON *v1_pod_statusJSON){ // v1_pod_status->container_statuses cJSON *container_statuses = cJSON_GetObjectItemCaseSensitive(v1_pod_statusJSON, "containerStatuses"); - list_t *container_statusesList; if (container_statuses) { - cJSON *container_statuses_local_nonprimitive; + cJSON *container_statuses_local_nonprimitive = NULL; if(!cJSON_IsArray(container_statuses)){ goto end; //nonprimitive container } @@ -341,9 +354,8 @@ v1_pod_status_t *v1_pod_status_parseFromJSON(cJSON *v1_pod_statusJSON){ // v1_pod_status->ephemeral_container_statuses cJSON *ephemeral_container_statuses = cJSON_GetObjectItemCaseSensitive(v1_pod_statusJSON, "ephemeralContainerStatuses"); - list_t *ephemeral_container_statusesList; if (ephemeral_container_statuses) { - cJSON *ephemeral_container_statuses_local_nonprimitive; + cJSON *ephemeral_container_statuses_local_nonprimitive = NULL; if(!cJSON_IsArray(ephemeral_container_statuses)){ goto end; //nonprimitive container } @@ -372,9 +384,8 @@ v1_pod_status_t *v1_pod_status_parseFromJSON(cJSON *v1_pod_statusJSON){ // v1_pod_status->init_container_statuses cJSON *init_container_statuses = cJSON_GetObjectItemCaseSensitive(v1_pod_statusJSON, "initContainerStatuses"); - list_t *init_container_statusesList; if (init_container_statuses) { - cJSON *init_container_statuses_local_nonprimitive; + cJSON *init_container_statuses_local_nonprimitive = NULL; if(!cJSON_IsArray(init_container_statuses)){ goto end; //nonprimitive container } @@ -430,9 +441,8 @@ v1_pod_status_t *v1_pod_status_parseFromJSON(cJSON *v1_pod_statusJSON){ // v1_pod_status->pod_ips cJSON *pod_ips = cJSON_GetObjectItemCaseSensitive(v1_pod_statusJSON, "podIPs"); - list_t *pod_ipsList; if (pod_ips) { - cJSON *pod_ips_local_nonprimitive; + cJSON *pod_ips_local_nonprimitive = NULL; if(!cJSON_IsArray(pod_ips)){ goto end; //nonprimitive container } @@ -496,6 +506,51 @@ v1_pod_status_t *v1_pod_status_parseFromJSON(cJSON *v1_pod_statusJSON){ return v1_pod_status_local_var; end: + if (conditionsList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, conditionsList) { + v1_pod_condition_free(listEntry->data); + listEntry->data = NULL; + } + list_freeList(conditionsList); + conditionsList = NULL; + } + if (container_statusesList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, container_statusesList) { + v1_container_status_free(listEntry->data); + listEntry->data = NULL; + } + list_freeList(container_statusesList); + container_statusesList = NULL; + } + if (ephemeral_container_statusesList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, ephemeral_container_statusesList) { + v1_container_status_free(listEntry->data); + listEntry->data = NULL; + } + list_freeList(ephemeral_container_statusesList); + ephemeral_container_statusesList = NULL; + } + if (init_container_statusesList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, init_container_statusesList) { + v1_container_status_free(listEntry->data); + listEntry->data = NULL; + } + list_freeList(init_container_statusesList); + init_container_statusesList = NULL; + } + if (pod_ipsList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, pod_ipsList) { + v1_pod_ip_free(listEntry->data); + listEntry->data = NULL; + } + list_freeList(pod_ipsList); + pod_ipsList = NULL; + } return NULL; } diff --git a/kubernetes/model/v1_pod_template_list.c b/kubernetes/model/v1_pod_template_list.c index 08b80c9c..65692422 100644 --- a/kubernetes/model/v1_pod_template_list.c +++ b/kubernetes/model/v1_pod_template_list.c @@ -116,6 +116,9 @@ v1_pod_template_list_t *v1_pod_template_list_parseFromJSON(cJSON *v1_pod_templat v1_pod_template_list_t *v1_pod_template_list_local_var = NULL; + // define the local list for v1_pod_template_list->items + list_t *itemsList = NULL; + // define the local variable for v1_pod_template_list->metadata v1_list_meta_t *metadata_local_nonprim = NULL; @@ -134,9 +137,8 @@ v1_pod_template_list_t *v1_pod_template_list_parseFromJSON(cJSON *v1_pod_templat goto end; } - list_t *itemsList; - cJSON *items_local_nonprimitive; + cJSON *items_local_nonprimitive = NULL; if(!cJSON_IsArray(items)){ goto end; //nonprimitive container } @@ -178,6 +180,15 @@ v1_pod_template_list_t *v1_pod_template_list_parseFromJSON(cJSON *v1_pod_templat return v1_pod_template_list_local_var; end: + if (itemsList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, itemsList) { + v1_pod_template_free(listEntry->data); + listEntry->data = NULL; + } + list_freeList(itemsList); + itemsList = NULL; + } if (metadata_local_nonprim) { v1_list_meta_free(metadata_local_nonprim); metadata_local_nonprim = NULL; diff --git a/kubernetes/model/v1_policy_rule.c b/kubernetes/model/v1_policy_rule.c index 84a02557..d7e25d72 100644 --- a/kubernetes/model/v1_policy_rule.c +++ b/kubernetes/model/v1_policy_rule.c @@ -170,11 +170,25 @@ v1_policy_rule_t *v1_policy_rule_parseFromJSON(cJSON *v1_policy_ruleJSON){ v1_policy_rule_t *v1_policy_rule_local_var = NULL; + // define the local list for v1_policy_rule->api_groups + list_t *api_groupsList = NULL; + + // define the local list for v1_policy_rule->non_resource_urls + list_t *non_resource_urlsList = NULL; + + // define the local list for v1_policy_rule->resource_names + list_t *resource_namesList = NULL; + + // define the local list for v1_policy_rule->resources + list_t *resourcesList = NULL; + + // define the local list for v1_policy_rule->verbs + list_t *verbsList = NULL; + // v1_policy_rule->api_groups cJSON *api_groups = cJSON_GetObjectItemCaseSensitive(v1_policy_ruleJSON, "apiGroups"); - list_t *api_groupsList; if (api_groups) { - cJSON *api_groups_local; + cJSON *api_groups_local = NULL; if(!cJSON_IsArray(api_groups)) { goto end;//primitive container } @@ -192,9 +206,8 @@ v1_policy_rule_t *v1_policy_rule_parseFromJSON(cJSON *v1_policy_ruleJSON){ // v1_policy_rule->non_resource_urls cJSON *non_resource_urls = cJSON_GetObjectItemCaseSensitive(v1_policy_ruleJSON, "nonResourceURLs"); - list_t *non_resource_urlsList; if (non_resource_urls) { - cJSON *non_resource_urls_local; + cJSON *non_resource_urls_local = NULL; if(!cJSON_IsArray(non_resource_urls)) { goto end;//primitive container } @@ -212,9 +225,8 @@ v1_policy_rule_t *v1_policy_rule_parseFromJSON(cJSON *v1_policy_ruleJSON){ // v1_policy_rule->resource_names cJSON *resource_names = cJSON_GetObjectItemCaseSensitive(v1_policy_ruleJSON, "resourceNames"); - list_t *resource_namesList; if (resource_names) { - cJSON *resource_names_local; + cJSON *resource_names_local = NULL; if(!cJSON_IsArray(resource_names)) { goto end;//primitive container } @@ -232,9 +244,8 @@ v1_policy_rule_t *v1_policy_rule_parseFromJSON(cJSON *v1_policy_ruleJSON){ // v1_policy_rule->resources cJSON *resources = cJSON_GetObjectItemCaseSensitive(v1_policy_ruleJSON, "resources"); - list_t *resourcesList; if (resources) { - cJSON *resources_local; + cJSON *resources_local = NULL; if(!cJSON_IsArray(resources)) { goto end;//primitive container } @@ -256,9 +267,8 @@ v1_policy_rule_t *v1_policy_rule_parseFromJSON(cJSON *v1_policy_ruleJSON){ goto end; } - list_t *verbsList; - cJSON *verbs_local; + cJSON *verbs_local = NULL; if(!cJSON_IsArray(verbs)) { goto end;//primitive container } @@ -284,6 +294,51 @@ v1_policy_rule_t *v1_policy_rule_parseFromJSON(cJSON *v1_policy_ruleJSON){ return v1_policy_rule_local_var; end: + if (api_groupsList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, api_groupsList) { + free(listEntry->data); + listEntry->data = NULL; + } + list_freeList(api_groupsList); + api_groupsList = NULL; + } + if (non_resource_urlsList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, non_resource_urlsList) { + free(listEntry->data); + listEntry->data = NULL; + } + list_freeList(non_resource_urlsList); + non_resource_urlsList = NULL; + } + if (resource_namesList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, resource_namesList) { + free(listEntry->data); + listEntry->data = NULL; + } + list_freeList(resource_namesList); + resource_namesList = NULL; + } + if (resourcesList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, resourcesList) { + free(listEntry->data); + listEntry->data = NULL; + } + list_freeList(resourcesList); + resourcesList = NULL; + } + if (verbsList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, verbsList) { + free(listEntry->data); + listEntry->data = NULL; + } + list_freeList(verbsList); + verbsList = NULL; + } return NULL; } diff --git a/kubernetes/model/v1_priority_class_list.c b/kubernetes/model/v1_priority_class_list.c index 1b70a01e..c332c63b 100644 --- a/kubernetes/model/v1_priority_class_list.c +++ b/kubernetes/model/v1_priority_class_list.c @@ -116,6 +116,9 @@ v1_priority_class_list_t *v1_priority_class_list_parseFromJSON(cJSON *v1_priorit v1_priority_class_list_t *v1_priority_class_list_local_var = NULL; + // define the local list for v1_priority_class_list->items + list_t *itemsList = NULL; + // define the local variable for v1_priority_class_list->metadata v1_list_meta_t *metadata_local_nonprim = NULL; @@ -134,9 +137,8 @@ v1_priority_class_list_t *v1_priority_class_list_parseFromJSON(cJSON *v1_priorit goto end; } - list_t *itemsList; - cJSON *items_local_nonprimitive; + cJSON *items_local_nonprimitive = NULL; if(!cJSON_IsArray(items)){ goto end; //nonprimitive container } @@ -178,6 +180,15 @@ v1_priority_class_list_t *v1_priority_class_list_parseFromJSON(cJSON *v1_priorit return v1_priority_class_list_local_var; end: + if (itemsList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, itemsList) { + v1_priority_class_free(listEntry->data); + listEntry->data = NULL; + } + list_freeList(itemsList); + itemsList = NULL; + } if (metadata_local_nonprim) { v1_list_meta_free(metadata_local_nonprim); metadata_local_nonprim = NULL; diff --git a/kubernetes/model/v1_projected_volume_source.c b/kubernetes/model/v1_projected_volume_source.c index c802d486..d19747e9 100644 --- a/kubernetes/model/v1_projected_volume_source.c +++ b/kubernetes/model/v1_projected_volume_source.c @@ -77,6 +77,9 @@ v1_projected_volume_source_t *v1_projected_volume_source_parseFromJSON(cJSON *v1 v1_projected_volume_source_t *v1_projected_volume_source_local_var = NULL; + // define the local list for v1_projected_volume_source->sources + list_t *sourcesList = NULL; + // v1_projected_volume_source->default_mode cJSON *default_mode = cJSON_GetObjectItemCaseSensitive(v1_projected_volume_sourceJSON, "defaultMode"); if (default_mode) { @@ -88,9 +91,8 @@ v1_projected_volume_source_t *v1_projected_volume_source_parseFromJSON(cJSON *v1 // v1_projected_volume_source->sources cJSON *sources = cJSON_GetObjectItemCaseSensitive(v1_projected_volume_sourceJSON, "sources"); - list_t *sourcesList; if (sources) { - cJSON *sources_local_nonprimitive; + cJSON *sources_local_nonprimitive = NULL; if(!cJSON_IsArray(sources)){ goto end; //nonprimitive container } @@ -116,6 +118,15 @@ v1_projected_volume_source_t *v1_projected_volume_source_parseFromJSON(cJSON *v1 return v1_projected_volume_source_local_var; end: + if (sourcesList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, sourcesList) { + v1_volume_projection_free(listEntry->data); + listEntry->data = NULL; + } + list_freeList(sourcesList); + sourcesList = NULL; + } return NULL; } diff --git a/kubernetes/model/v1_rbd_persistent_volume_source.c b/kubernetes/model/v1_rbd_persistent_volume_source.c index 5c9bf2f1..9ea663da 100644 --- a/kubernetes/model/v1_rbd_persistent_volume_source.c +++ b/kubernetes/model/v1_rbd_persistent_volume_source.c @@ -167,6 +167,9 @@ v1_rbd_persistent_volume_source_t *v1_rbd_persistent_volume_source_parseFromJSON v1_rbd_persistent_volume_source_t *v1_rbd_persistent_volume_source_local_var = NULL; + // define the local list for v1_rbd_persistent_volume_source->monitors + list_t *monitorsList = NULL; + // define the local variable for v1_rbd_persistent_volume_source->secret_ref v1_secret_reference_t *secret_ref_local_nonprim = NULL; @@ -206,9 +209,8 @@ v1_rbd_persistent_volume_source_t *v1_rbd_persistent_volume_source_parseFromJSON goto end; } - list_t *monitorsList; - cJSON *monitors_local; + cJSON *monitors_local = NULL; if(!cJSON_IsArray(monitors)) { goto end;//primitive container } @@ -270,6 +272,15 @@ v1_rbd_persistent_volume_source_t *v1_rbd_persistent_volume_source_parseFromJSON return v1_rbd_persistent_volume_source_local_var; end: + if (monitorsList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, monitorsList) { + free(listEntry->data); + listEntry->data = NULL; + } + list_freeList(monitorsList); + monitorsList = NULL; + } if (secret_ref_local_nonprim) { v1_secret_reference_free(secret_ref_local_nonprim); secret_ref_local_nonprim = NULL; diff --git a/kubernetes/model/v1_rbd_volume_source.c b/kubernetes/model/v1_rbd_volume_source.c index 9c2853f7..c1d5f3b0 100644 --- a/kubernetes/model/v1_rbd_volume_source.c +++ b/kubernetes/model/v1_rbd_volume_source.c @@ -167,6 +167,9 @@ v1_rbd_volume_source_t *v1_rbd_volume_source_parseFromJSON(cJSON *v1_rbd_volume_ v1_rbd_volume_source_t *v1_rbd_volume_source_local_var = NULL; + // define the local list for v1_rbd_volume_source->monitors + list_t *monitorsList = NULL; + // define the local variable for v1_rbd_volume_source->secret_ref v1_local_object_reference_t *secret_ref_local_nonprim = NULL; @@ -206,9 +209,8 @@ v1_rbd_volume_source_t *v1_rbd_volume_source_parseFromJSON(cJSON *v1_rbd_volume_ goto end; } - list_t *monitorsList; - cJSON *monitors_local; + cJSON *monitors_local = NULL; if(!cJSON_IsArray(monitors)) { goto end;//primitive container } @@ -270,6 +272,15 @@ v1_rbd_volume_source_t *v1_rbd_volume_source_parseFromJSON(cJSON *v1_rbd_volume_ return v1_rbd_volume_source_local_var; end: + if (monitorsList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, monitorsList) { + free(listEntry->data); + listEntry->data = NULL; + } + list_freeList(monitorsList); + monitorsList = NULL; + } if (secret_ref_local_nonprim) { v1_local_object_reference_free(secret_ref_local_nonprim); secret_ref_local_nonprim = NULL; diff --git a/kubernetes/model/v1_replica_set_list.c b/kubernetes/model/v1_replica_set_list.c index 7eb7f7e8..e53755c0 100644 --- a/kubernetes/model/v1_replica_set_list.c +++ b/kubernetes/model/v1_replica_set_list.c @@ -116,6 +116,9 @@ v1_replica_set_list_t *v1_replica_set_list_parseFromJSON(cJSON *v1_replica_set_l v1_replica_set_list_t *v1_replica_set_list_local_var = NULL; + // define the local list for v1_replica_set_list->items + list_t *itemsList = NULL; + // define the local variable for v1_replica_set_list->metadata v1_list_meta_t *metadata_local_nonprim = NULL; @@ -134,9 +137,8 @@ v1_replica_set_list_t *v1_replica_set_list_parseFromJSON(cJSON *v1_replica_set_l goto end; } - list_t *itemsList; - cJSON *items_local_nonprimitive; + cJSON *items_local_nonprimitive = NULL; if(!cJSON_IsArray(items)){ goto end; //nonprimitive container } @@ -178,6 +180,15 @@ v1_replica_set_list_t *v1_replica_set_list_parseFromJSON(cJSON *v1_replica_set_l return v1_replica_set_list_local_var; end: + if (itemsList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, itemsList) { + v1_replica_set_free(listEntry->data); + listEntry->data = NULL; + } + list_freeList(itemsList); + itemsList = NULL; + } if (metadata_local_nonprim) { v1_list_meta_free(metadata_local_nonprim); metadata_local_nonprim = NULL; diff --git a/kubernetes/model/v1_replica_set_status.c b/kubernetes/model/v1_replica_set_status.c index be6d472b..1a63ce76 100644 --- a/kubernetes/model/v1_replica_set_status.c +++ b/kubernetes/model/v1_replica_set_status.c @@ -119,6 +119,9 @@ v1_replica_set_status_t *v1_replica_set_status_parseFromJSON(cJSON *v1_replica_s v1_replica_set_status_t *v1_replica_set_status_local_var = NULL; + // define the local list for v1_replica_set_status->conditions + list_t *conditionsList = NULL; + // v1_replica_set_status->available_replicas cJSON *available_replicas = cJSON_GetObjectItemCaseSensitive(v1_replica_set_statusJSON, "availableReplicas"); if (available_replicas) { @@ -130,9 +133,8 @@ v1_replica_set_status_t *v1_replica_set_status_parseFromJSON(cJSON *v1_replica_s // v1_replica_set_status->conditions cJSON *conditions = cJSON_GetObjectItemCaseSensitive(v1_replica_set_statusJSON, "conditions"); - list_t *conditionsList; if (conditions) { - cJSON *conditions_local_nonprimitive; + cJSON *conditions_local_nonprimitive = NULL; if(!cJSON_IsArray(conditions)){ goto end; //nonprimitive container } @@ -201,6 +203,15 @@ v1_replica_set_status_t *v1_replica_set_status_parseFromJSON(cJSON *v1_replica_s return v1_replica_set_status_local_var; end: + if (conditionsList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, conditionsList) { + v1_replica_set_condition_free(listEntry->data); + listEntry->data = NULL; + } + list_freeList(conditionsList); + conditionsList = NULL; + } return NULL; } diff --git a/kubernetes/model/v1_replication_controller_list.c b/kubernetes/model/v1_replication_controller_list.c index 8298007a..5a185e38 100644 --- a/kubernetes/model/v1_replication_controller_list.c +++ b/kubernetes/model/v1_replication_controller_list.c @@ -116,6 +116,9 @@ v1_replication_controller_list_t *v1_replication_controller_list_parseFromJSON(c v1_replication_controller_list_t *v1_replication_controller_list_local_var = NULL; + // define the local list for v1_replication_controller_list->items + list_t *itemsList = NULL; + // define the local variable for v1_replication_controller_list->metadata v1_list_meta_t *metadata_local_nonprim = NULL; @@ -134,9 +137,8 @@ v1_replication_controller_list_t *v1_replication_controller_list_parseFromJSON(c goto end; } - list_t *itemsList; - cJSON *items_local_nonprimitive; + cJSON *items_local_nonprimitive = NULL; if(!cJSON_IsArray(items)){ goto end; //nonprimitive container } @@ -178,6 +180,15 @@ v1_replication_controller_list_t *v1_replication_controller_list_parseFromJSON(c return v1_replication_controller_list_local_var; end: + if (itemsList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, itemsList) { + v1_replication_controller_free(listEntry->data); + listEntry->data = NULL; + } + list_freeList(itemsList); + itemsList = NULL; + } if (metadata_local_nonprim) { v1_list_meta_free(metadata_local_nonprim); metadata_local_nonprim = NULL; diff --git a/kubernetes/model/v1_replication_controller_spec.c b/kubernetes/model/v1_replication_controller_spec.c index b5489035..6ee7bf35 100644 --- a/kubernetes/model/v1_replication_controller_spec.c +++ b/kubernetes/model/v1_replication_controller_spec.c @@ -109,6 +109,9 @@ v1_replication_controller_spec_t *v1_replication_controller_spec_parseFromJSON(c v1_replication_controller_spec_t *v1_replication_controller_spec_local_var = NULL; + // define the local map for v1_replication_controller_spec->selector + list_t *selectorList = NULL; + // define the local variable for v1_replication_controller_spec->_template v1_pod_template_spec_t *_template_local_nonprim = NULL; @@ -132,9 +135,8 @@ v1_replication_controller_spec_t *v1_replication_controller_spec_parseFromJSON(c // v1_replication_controller_spec->selector cJSON *selector = cJSON_GetObjectItemCaseSensitive(v1_replication_controller_specJSON, "selector"); - list_t *selectorList; if (selector) { - cJSON *selector_local_map; + cJSON *selector_local_map = NULL; if(!cJSON_IsObject(selector)) { goto end;//primitive map container } @@ -168,6 +170,20 @@ v1_replication_controller_spec_t *v1_replication_controller_spec_parseFromJSON(c return v1_replication_controller_spec_local_var; end: + if (selectorList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, selectorList) { + keyValuePair_t *localKeyValue = (keyValuePair_t*) listEntry->data; + free(localKeyValue->key); + localKeyValue->key = NULL; + free(localKeyValue->value); + localKeyValue->value = NULL; + keyValuePair_free(localKeyValue); + localKeyValue = NULL; + } + list_freeList(selectorList); + selectorList = NULL; + } if (_template_local_nonprim) { v1_pod_template_spec_free(_template_local_nonprim); _template_local_nonprim = NULL; diff --git a/kubernetes/model/v1_replication_controller_status.c b/kubernetes/model/v1_replication_controller_status.c index 6e5a2877..c6ba6066 100644 --- a/kubernetes/model/v1_replication_controller_status.c +++ b/kubernetes/model/v1_replication_controller_status.c @@ -119,6 +119,9 @@ v1_replication_controller_status_t *v1_replication_controller_status_parseFromJS v1_replication_controller_status_t *v1_replication_controller_status_local_var = NULL; + // define the local list for v1_replication_controller_status->conditions + list_t *conditionsList = NULL; + // v1_replication_controller_status->available_replicas cJSON *available_replicas = cJSON_GetObjectItemCaseSensitive(v1_replication_controller_statusJSON, "availableReplicas"); if (available_replicas) { @@ -130,9 +133,8 @@ v1_replication_controller_status_t *v1_replication_controller_status_parseFromJS // v1_replication_controller_status->conditions cJSON *conditions = cJSON_GetObjectItemCaseSensitive(v1_replication_controller_statusJSON, "conditions"); - list_t *conditionsList; if (conditions) { - cJSON *conditions_local_nonprimitive; + cJSON *conditions_local_nonprimitive = NULL; if(!cJSON_IsArray(conditions)){ goto end; //nonprimitive container } @@ -201,6 +203,15 @@ v1_replication_controller_status_t *v1_replication_controller_status_parseFromJS return v1_replication_controller_status_local_var; end: + if (conditionsList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, conditionsList) { + v1_replication_controller_condition_free(listEntry->data); + listEntry->data = NULL; + } + list_freeList(conditionsList); + conditionsList = NULL; + } return NULL; } diff --git a/kubernetes/model/v1_resource_quota_list.c b/kubernetes/model/v1_resource_quota_list.c index b11150e8..2bec6124 100644 --- a/kubernetes/model/v1_resource_quota_list.c +++ b/kubernetes/model/v1_resource_quota_list.c @@ -116,6 +116,9 @@ v1_resource_quota_list_t *v1_resource_quota_list_parseFromJSON(cJSON *v1_resourc v1_resource_quota_list_t *v1_resource_quota_list_local_var = NULL; + // define the local list for v1_resource_quota_list->items + list_t *itemsList = NULL; + // define the local variable for v1_resource_quota_list->metadata v1_list_meta_t *metadata_local_nonprim = NULL; @@ -134,9 +137,8 @@ v1_resource_quota_list_t *v1_resource_quota_list_parseFromJSON(cJSON *v1_resourc goto end; } - list_t *itemsList; - cJSON *items_local_nonprimitive; + cJSON *items_local_nonprimitive = NULL; if(!cJSON_IsArray(items)){ goto end; //nonprimitive container } @@ -178,6 +180,15 @@ v1_resource_quota_list_t *v1_resource_quota_list_parseFromJSON(cJSON *v1_resourc return v1_resource_quota_list_local_var; end: + if (itemsList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, itemsList) { + v1_resource_quota_free(listEntry->data); + listEntry->data = NULL; + } + list_freeList(itemsList); + itemsList = NULL; + } if (metadata_local_nonprim) { v1_list_meta_free(metadata_local_nonprim); metadata_local_nonprim = NULL; diff --git a/kubernetes/model/v1_resource_quota_spec.c b/kubernetes/model/v1_resource_quota_spec.c index 26c2a4d1..838b937e 100644 --- a/kubernetes/model/v1_resource_quota_spec.c +++ b/kubernetes/model/v1_resource_quota_spec.c @@ -115,14 +115,19 @@ v1_resource_quota_spec_t *v1_resource_quota_spec_parseFromJSON(cJSON *v1_resourc v1_resource_quota_spec_t *v1_resource_quota_spec_local_var = NULL; + // define the local map for v1_resource_quota_spec->hard + list_t *hardList = NULL; + // define the local variable for v1_resource_quota_spec->scope_selector v1_scope_selector_t *scope_selector_local_nonprim = NULL; + // define the local list for v1_resource_quota_spec->scopes + list_t *scopesList = NULL; + // v1_resource_quota_spec->hard cJSON *hard = cJSON_GetObjectItemCaseSensitive(v1_resource_quota_specJSON, "hard"); - list_t *hardList; if (hard) { - cJSON *hard_local_map; + cJSON *hard_local_map = NULL; if(!cJSON_IsObject(hard)) { goto end;//primitive map container } @@ -148,9 +153,8 @@ v1_resource_quota_spec_t *v1_resource_quota_spec_parseFromJSON(cJSON *v1_resourc // v1_resource_quota_spec->scopes cJSON *scopes = cJSON_GetObjectItemCaseSensitive(v1_resource_quota_specJSON, "scopes"); - list_t *scopesList; if (scopes) { - cJSON *scopes_local; + cJSON *scopes_local = NULL; if(!cJSON_IsArray(scopes)) { goto end;//primitive container } @@ -175,10 +179,33 @@ v1_resource_quota_spec_t *v1_resource_quota_spec_parseFromJSON(cJSON *v1_resourc return v1_resource_quota_spec_local_var; end: + if (hardList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, hardList) { + keyValuePair_t *localKeyValue = (keyValuePair_t*) listEntry->data; + free(localKeyValue->key); + localKeyValue->key = NULL; + free(localKeyValue->value); + localKeyValue->value = NULL; + keyValuePair_free(localKeyValue); + localKeyValue = NULL; + } + list_freeList(hardList); + hardList = NULL; + } if (scope_selector_local_nonprim) { v1_scope_selector_free(scope_selector_local_nonprim); scope_selector_local_nonprim = NULL; } + if (scopesList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, scopesList) { + free(listEntry->data); + listEntry->data = NULL; + } + list_freeList(scopesList); + scopesList = NULL; + } return NULL; } diff --git a/kubernetes/model/v1_resource_quota_status.c b/kubernetes/model/v1_resource_quota_status.c index 11db4c38..a13896b6 100644 --- a/kubernetes/model/v1_resource_quota_status.c +++ b/kubernetes/model/v1_resource_quota_status.c @@ -102,11 +102,16 @@ v1_resource_quota_status_t *v1_resource_quota_status_parseFromJSON(cJSON *v1_res v1_resource_quota_status_t *v1_resource_quota_status_local_var = NULL; + // define the local map for v1_resource_quota_status->hard + list_t *hardList = NULL; + + // define the local map for v1_resource_quota_status->used + list_t *usedList = NULL; + // v1_resource_quota_status->hard cJSON *hard = cJSON_GetObjectItemCaseSensitive(v1_resource_quota_statusJSON, "hard"); - list_t *hardList; if (hard) { - cJSON *hard_local_map; + cJSON *hard_local_map = NULL; if(!cJSON_IsObject(hard)) { goto end;//primitive map container } @@ -126,9 +131,8 @@ v1_resource_quota_status_t *v1_resource_quota_status_parseFromJSON(cJSON *v1_res // v1_resource_quota_status->used cJSON *used = cJSON_GetObjectItemCaseSensitive(v1_resource_quota_statusJSON, "used"); - list_t *usedList; if (used) { - cJSON *used_local_map; + cJSON *used_local_map = NULL; if(!cJSON_IsObject(used)) { goto end;//primitive map container } @@ -154,6 +158,34 @@ v1_resource_quota_status_t *v1_resource_quota_status_parseFromJSON(cJSON *v1_res return v1_resource_quota_status_local_var; end: + if (hardList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, hardList) { + keyValuePair_t *localKeyValue = (keyValuePair_t*) listEntry->data; + free(localKeyValue->key); + localKeyValue->key = NULL; + free(localKeyValue->value); + localKeyValue->value = NULL; + keyValuePair_free(localKeyValue); + localKeyValue = NULL; + } + list_freeList(hardList); + hardList = NULL; + } + if (usedList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, usedList) { + keyValuePair_t *localKeyValue = (keyValuePair_t*) listEntry->data; + free(localKeyValue->key); + localKeyValue->key = NULL; + free(localKeyValue->value); + localKeyValue->value = NULL; + keyValuePair_free(localKeyValue); + localKeyValue = NULL; + } + list_freeList(usedList); + usedList = NULL; + } return NULL; } diff --git a/kubernetes/model/v1_resource_requirements.c b/kubernetes/model/v1_resource_requirements.c index 366ec797..bb6fb124 100644 --- a/kubernetes/model/v1_resource_requirements.c +++ b/kubernetes/model/v1_resource_requirements.c @@ -102,11 +102,16 @@ v1_resource_requirements_t *v1_resource_requirements_parseFromJSON(cJSON *v1_res v1_resource_requirements_t *v1_resource_requirements_local_var = NULL; + // define the local map for v1_resource_requirements->limits + list_t *limitsList = NULL; + + // define the local map for v1_resource_requirements->requests + list_t *requestsList = NULL; + // v1_resource_requirements->limits cJSON *limits = cJSON_GetObjectItemCaseSensitive(v1_resource_requirementsJSON, "limits"); - list_t *limitsList; if (limits) { - cJSON *limits_local_map; + cJSON *limits_local_map = NULL; if(!cJSON_IsObject(limits)) { goto end;//primitive map container } @@ -126,9 +131,8 @@ v1_resource_requirements_t *v1_resource_requirements_parseFromJSON(cJSON *v1_res // v1_resource_requirements->requests cJSON *requests = cJSON_GetObjectItemCaseSensitive(v1_resource_requirementsJSON, "requests"); - list_t *requestsList; if (requests) { - cJSON *requests_local_map; + cJSON *requests_local_map = NULL; if(!cJSON_IsObject(requests)) { goto end;//primitive map container } @@ -154,6 +158,34 @@ v1_resource_requirements_t *v1_resource_requirements_parseFromJSON(cJSON *v1_res return v1_resource_requirements_local_var; end: + if (limitsList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, limitsList) { + keyValuePair_t *localKeyValue = (keyValuePair_t*) listEntry->data; + free(localKeyValue->key); + localKeyValue->key = NULL; + free(localKeyValue->value); + localKeyValue->value = NULL; + keyValuePair_free(localKeyValue); + localKeyValue = NULL; + } + list_freeList(limitsList); + limitsList = NULL; + } + if (requestsList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, requestsList) { + keyValuePair_t *localKeyValue = (keyValuePair_t*) listEntry->data; + free(localKeyValue->key); + localKeyValue->key = NULL; + free(localKeyValue->value); + localKeyValue->value = NULL; + keyValuePair_free(localKeyValue); + localKeyValue = NULL; + } + list_freeList(requestsList); + requestsList = NULL; + } return NULL; } diff --git a/kubernetes/model/v1_resource_rule.c b/kubernetes/model/v1_resource_rule.c index 185278c3..5f52532e 100644 --- a/kubernetes/model/v1_resource_rule.c +++ b/kubernetes/model/v1_resource_rule.c @@ -144,11 +144,22 @@ v1_resource_rule_t *v1_resource_rule_parseFromJSON(cJSON *v1_resource_ruleJSON){ v1_resource_rule_t *v1_resource_rule_local_var = NULL; + // define the local list for v1_resource_rule->api_groups + list_t *api_groupsList = NULL; + + // define the local list for v1_resource_rule->resource_names + list_t *resource_namesList = NULL; + + // define the local list for v1_resource_rule->resources + list_t *resourcesList = NULL; + + // define the local list for v1_resource_rule->verbs + list_t *verbsList = NULL; + // v1_resource_rule->api_groups cJSON *api_groups = cJSON_GetObjectItemCaseSensitive(v1_resource_ruleJSON, "apiGroups"); - list_t *api_groupsList; if (api_groups) { - cJSON *api_groups_local; + cJSON *api_groups_local = NULL; if(!cJSON_IsArray(api_groups)) { goto end;//primitive container } @@ -166,9 +177,8 @@ v1_resource_rule_t *v1_resource_rule_parseFromJSON(cJSON *v1_resource_ruleJSON){ // v1_resource_rule->resource_names cJSON *resource_names = cJSON_GetObjectItemCaseSensitive(v1_resource_ruleJSON, "resourceNames"); - list_t *resource_namesList; if (resource_names) { - cJSON *resource_names_local; + cJSON *resource_names_local = NULL; if(!cJSON_IsArray(resource_names)) { goto end;//primitive container } @@ -186,9 +196,8 @@ v1_resource_rule_t *v1_resource_rule_parseFromJSON(cJSON *v1_resource_ruleJSON){ // v1_resource_rule->resources cJSON *resources = cJSON_GetObjectItemCaseSensitive(v1_resource_ruleJSON, "resources"); - list_t *resourcesList; if (resources) { - cJSON *resources_local; + cJSON *resources_local = NULL; if(!cJSON_IsArray(resources)) { goto end;//primitive container } @@ -210,9 +219,8 @@ v1_resource_rule_t *v1_resource_rule_parseFromJSON(cJSON *v1_resource_ruleJSON){ goto end; } - list_t *verbsList; - cJSON *verbs_local; + cJSON *verbs_local = NULL; if(!cJSON_IsArray(verbs)) { goto end;//primitive container } @@ -237,6 +245,42 @@ v1_resource_rule_t *v1_resource_rule_parseFromJSON(cJSON *v1_resource_ruleJSON){ return v1_resource_rule_local_var; end: + if (api_groupsList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, api_groupsList) { + free(listEntry->data); + listEntry->data = NULL; + } + list_freeList(api_groupsList); + api_groupsList = NULL; + } + if (resource_namesList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, resource_namesList) { + free(listEntry->data); + listEntry->data = NULL; + } + list_freeList(resource_namesList); + resource_namesList = NULL; + } + if (resourcesList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, resourcesList) { + free(listEntry->data); + listEntry->data = NULL; + } + list_freeList(resourcesList); + resourcesList = NULL; + } + if (verbsList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, verbsList) { + free(listEntry->data); + listEntry->data = NULL; + } + list_freeList(verbsList); + verbsList = NULL; + } return NULL; } diff --git a/kubernetes/model/v1_role.c b/kubernetes/model/v1_role.c index 38a86bdc..0a60c3ea 100644 --- a/kubernetes/model/v1_role.c +++ b/kubernetes/model/v1_role.c @@ -117,6 +117,9 @@ v1_role_t *v1_role_parseFromJSON(cJSON *v1_roleJSON){ // define the local variable for v1_role->metadata v1_object_meta_t *metadata_local_nonprim = NULL; + // define the local list for v1_role->rules + list_t *rulesList = NULL; + // v1_role->api_version cJSON *api_version = cJSON_GetObjectItemCaseSensitive(v1_roleJSON, "apiVersion"); if (api_version) { @@ -143,9 +146,8 @@ v1_role_t *v1_role_parseFromJSON(cJSON *v1_roleJSON){ // v1_role->rules cJSON *rules = cJSON_GetObjectItemCaseSensitive(v1_roleJSON, "rules"); - list_t *rulesList; if (rules) { - cJSON *rules_local_nonprimitive; + cJSON *rules_local_nonprimitive = NULL; if(!cJSON_IsArray(rules)){ goto end; //nonprimitive container } @@ -177,6 +179,15 @@ v1_role_t *v1_role_parseFromJSON(cJSON *v1_roleJSON){ v1_object_meta_free(metadata_local_nonprim); metadata_local_nonprim = NULL; } + if (rulesList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, rulesList) { + v1_policy_rule_free(listEntry->data); + listEntry->data = NULL; + } + list_freeList(rulesList); + rulesList = NULL; + } return NULL; } diff --git a/kubernetes/model/v1_role_binding.c b/kubernetes/model/v1_role_binding.c index 12190fc2..fd362759 100644 --- a/kubernetes/model/v1_role_binding.c +++ b/kubernetes/model/v1_role_binding.c @@ -141,6 +141,9 @@ v1_role_binding_t *v1_role_binding_parseFromJSON(cJSON *v1_role_bindingJSON){ // define the local variable for v1_role_binding->role_ref v1_role_ref_t *role_ref_local_nonprim = NULL; + // define the local list for v1_role_binding->subjects + list_t *subjectsList = NULL; + // v1_role_binding->api_version cJSON *api_version = cJSON_GetObjectItemCaseSensitive(v1_role_bindingJSON, "apiVersion"); if (api_version) { @@ -176,9 +179,8 @@ v1_role_binding_t *v1_role_binding_parseFromJSON(cJSON *v1_role_bindingJSON){ // v1_role_binding->subjects cJSON *subjects = cJSON_GetObjectItemCaseSensitive(v1_role_bindingJSON, "subjects"); - list_t *subjectsList; if (subjects) { - cJSON *subjects_local_nonprimitive; + cJSON *subjects_local_nonprimitive = NULL; if(!cJSON_IsArray(subjects)){ goto end; //nonprimitive container } @@ -215,6 +217,15 @@ v1_role_binding_t *v1_role_binding_parseFromJSON(cJSON *v1_role_bindingJSON){ v1_role_ref_free(role_ref_local_nonprim); role_ref_local_nonprim = NULL; } + if (subjectsList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, subjectsList) { + v1_subject_free(listEntry->data); + listEntry->data = NULL; + } + list_freeList(subjectsList); + subjectsList = NULL; + } return NULL; } diff --git a/kubernetes/model/v1_role_binding_list.c b/kubernetes/model/v1_role_binding_list.c index 16861293..ea130dc5 100644 --- a/kubernetes/model/v1_role_binding_list.c +++ b/kubernetes/model/v1_role_binding_list.c @@ -116,6 +116,9 @@ v1_role_binding_list_t *v1_role_binding_list_parseFromJSON(cJSON *v1_role_bindin v1_role_binding_list_t *v1_role_binding_list_local_var = NULL; + // define the local list for v1_role_binding_list->items + list_t *itemsList = NULL; + // define the local variable for v1_role_binding_list->metadata v1_list_meta_t *metadata_local_nonprim = NULL; @@ -134,9 +137,8 @@ v1_role_binding_list_t *v1_role_binding_list_parseFromJSON(cJSON *v1_role_bindin goto end; } - list_t *itemsList; - cJSON *items_local_nonprimitive; + cJSON *items_local_nonprimitive = NULL; if(!cJSON_IsArray(items)){ goto end; //nonprimitive container } @@ -178,6 +180,15 @@ v1_role_binding_list_t *v1_role_binding_list_parseFromJSON(cJSON *v1_role_bindin return v1_role_binding_list_local_var; end: + if (itemsList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, itemsList) { + v1_role_binding_free(listEntry->data); + listEntry->data = NULL; + } + list_freeList(itemsList); + itemsList = NULL; + } if (metadata_local_nonprim) { v1_list_meta_free(metadata_local_nonprim); metadata_local_nonprim = NULL; diff --git a/kubernetes/model/v1_role_list.c b/kubernetes/model/v1_role_list.c index 62a0f81a..517e2d14 100644 --- a/kubernetes/model/v1_role_list.c +++ b/kubernetes/model/v1_role_list.c @@ -116,6 +116,9 @@ v1_role_list_t *v1_role_list_parseFromJSON(cJSON *v1_role_listJSON){ v1_role_list_t *v1_role_list_local_var = NULL; + // define the local list for v1_role_list->items + list_t *itemsList = NULL; + // define the local variable for v1_role_list->metadata v1_list_meta_t *metadata_local_nonprim = NULL; @@ -134,9 +137,8 @@ v1_role_list_t *v1_role_list_parseFromJSON(cJSON *v1_role_listJSON){ goto end; } - list_t *itemsList; - cJSON *items_local_nonprimitive; + cJSON *items_local_nonprimitive = NULL; if(!cJSON_IsArray(items)){ goto end; //nonprimitive container } @@ -178,6 +180,15 @@ v1_role_list_t *v1_role_list_parseFromJSON(cJSON *v1_role_listJSON){ return v1_role_list_local_var; end: + if (itemsList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, itemsList) { + v1_role_free(listEntry->data); + listEntry->data = NULL; + } + list_freeList(itemsList); + itemsList = NULL; + } if (metadata_local_nonprim) { v1_list_meta_free(metadata_local_nonprim); metadata_local_nonprim = NULL; diff --git a/kubernetes/model/v1_rule_with_operations.c b/kubernetes/model/v1_rule_with_operations.c index ad67c780..eb50d7bc 100644 --- a/kubernetes/model/v1_rule_with_operations.c +++ b/kubernetes/model/v1_rule_with_operations.c @@ -156,11 +156,22 @@ v1_rule_with_operations_t *v1_rule_with_operations_parseFromJSON(cJSON *v1_rule_ v1_rule_with_operations_t *v1_rule_with_operations_local_var = NULL; + // define the local list for v1_rule_with_operations->api_groups + list_t *api_groupsList = NULL; + + // define the local list for v1_rule_with_operations->api_versions + list_t *api_versionsList = NULL; + + // define the local list for v1_rule_with_operations->operations + list_t *operationsList = NULL; + + // define the local list for v1_rule_with_operations->resources + list_t *resourcesList = NULL; + // v1_rule_with_operations->api_groups cJSON *api_groups = cJSON_GetObjectItemCaseSensitive(v1_rule_with_operationsJSON, "apiGroups"); - list_t *api_groupsList; if (api_groups) { - cJSON *api_groups_local; + cJSON *api_groups_local = NULL; if(!cJSON_IsArray(api_groups)) { goto end;//primitive container } @@ -178,9 +189,8 @@ v1_rule_with_operations_t *v1_rule_with_operations_parseFromJSON(cJSON *v1_rule_ // v1_rule_with_operations->api_versions cJSON *api_versions = cJSON_GetObjectItemCaseSensitive(v1_rule_with_operationsJSON, "apiVersions"); - list_t *api_versionsList; if (api_versions) { - cJSON *api_versions_local; + cJSON *api_versions_local = NULL; if(!cJSON_IsArray(api_versions)) { goto end;//primitive container } @@ -198,9 +208,8 @@ v1_rule_with_operations_t *v1_rule_with_operations_parseFromJSON(cJSON *v1_rule_ // v1_rule_with_operations->operations cJSON *operations = cJSON_GetObjectItemCaseSensitive(v1_rule_with_operationsJSON, "operations"); - list_t *operationsList; if (operations) { - cJSON *operations_local; + cJSON *operations_local = NULL; if(!cJSON_IsArray(operations)) { goto end;//primitive container } @@ -218,9 +227,8 @@ v1_rule_with_operations_t *v1_rule_with_operations_parseFromJSON(cJSON *v1_rule_ // v1_rule_with_operations->resources cJSON *resources = cJSON_GetObjectItemCaseSensitive(v1_rule_with_operationsJSON, "resources"); - list_t *resourcesList; if (resources) { - cJSON *resources_local; + cJSON *resources_local = NULL; if(!cJSON_IsArray(resources)) { goto end;//primitive container } @@ -256,6 +264,42 @@ v1_rule_with_operations_t *v1_rule_with_operations_parseFromJSON(cJSON *v1_rule_ return v1_rule_with_operations_local_var; end: + if (api_groupsList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, api_groupsList) { + free(listEntry->data); + listEntry->data = NULL; + } + list_freeList(api_groupsList); + api_groupsList = NULL; + } + if (api_versionsList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, api_versionsList) { + free(listEntry->data); + listEntry->data = NULL; + } + list_freeList(api_versionsList); + api_versionsList = NULL; + } + if (operationsList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, operationsList) { + free(listEntry->data); + listEntry->data = NULL; + } + list_freeList(operationsList); + operationsList = NULL; + } + if (resourcesList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, resourcesList) { + free(listEntry->data); + listEntry->data = NULL; + } + list_freeList(resourcesList); + resourcesList = NULL; + } return NULL; } diff --git a/kubernetes/model/v1_runtime_class_list.c b/kubernetes/model/v1_runtime_class_list.c index 4e554ce5..175e4006 100644 --- a/kubernetes/model/v1_runtime_class_list.c +++ b/kubernetes/model/v1_runtime_class_list.c @@ -116,6 +116,9 @@ v1_runtime_class_list_t *v1_runtime_class_list_parseFromJSON(cJSON *v1_runtime_c v1_runtime_class_list_t *v1_runtime_class_list_local_var = NULL; + // define the local list for v1_runtime_class_list->items + list_t *itemsList = NULL; + // define the local variable for v1_runtime_class_list->metadata v1_list_meta_t *metadata_local_nonprim = NULL; @@ -134,9 +137,8 @@ v1_runtime_class_list_t *v1_runtime_class_list_parseFromJSON(cJSON *v1_runtime_c goto end; } - list_t *itemsList; - cJSON *items_local_nonprimitive; + cJSON *items_local_nonprimitive = NULL; if(!cJSON_IsArray(items)){ goto end; //nonprimitive container } @@ -178,6 +180,15 @@ v1_runtime_class_list_t *v1_runtime_class_list_parseFromJSON(cJSON *v1_runtime_c return v1_runtime_class_list_local_var; end: + if (itemsList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, itemsList) { + v1_runtime_class_free(listEntry->data); + listEntry->data = NULL; + } + list_freeList(itemsList); + itemsList = NULL; + } if (metadata_local_nonprim) { v1_list_meta_free(metadata_local_nonprim); metadata_local_nonprim = NULL; diff --git a/kubernetes/model/v1_scheduling.c b/kubernetes/model/v1_scheduling.c index d0a869ec..096aa4ee 100644 --- a/kubernetes/model/v1_scheduling.c +++ b/kubernetes/model/v1_scheduling.c @@ -99,11 +99,16 @@ v1_scheduling_t *v1_scheduling_parseFromJSON(cJSON *v1_schedulingJSON){ v1_scheduling_t *v1_scheduling_local_var = NULL; + // define the local map for v1_scheduling->node_selector + list_t *node_selectorList = NULL; + + // define the local list for v1_scheduling->tolerations + list_t *tolerationsList = NULL; + // v1_scheduling->node_selector cJSON *node_selector = cJSON_GetObjectItemCaseSensitive(v1_schedulingJSON, "nodeSelector"); - list_t *node_selectorList; if (node_selector) { - cJSON *node_selector_local_map; + cJSON *node_selector_local_map = NULL; if(!cJSON_IsObject(node_selector)) { goto end;//primitive map container } @@ -123,9 +128,8 @@ v1_scheduling_t *v1_scheduling_parseFromJSON(cJSON *v1_schedulingJSON){ // v1_scheduling->tolerations cJSON *tolerations = cJSON_GetObjectItemCaseSensitive(v1_schedulingJSON, "tolerations"); - list_t *tolerationsList; if (tolerations) { - cJSON *tolerations_local_nonprimitive; + cJSON *tolerations_local_nonprimitive = NULL; if(!cJSON_IsArray(tolerations)){ goto end; //nonprimitive container } @@ -151,6 +155,29 @@ v1_scheduling_t *v1_scheduling_parseFromJSON(cJSON *v1_schedulingJSON){ return v1_scheduling_local_var; end: + if (node_selectorList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, node_selectorList) { + keyValuePair_t *localKeyValue = (keyValuePair_t*) listEntry->data; + free(localKeyValue->key); + localKeyValue->key = NULL; + free(localKeyValue->value); + localKeyValue->value = NULL; + keyValuePair_free(localKeyValue); + localKeyValue = NULL; + } + list_freeList(node_selectorList); + node_selectorList = NULL; + } + if (tolerationsList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, tolerationsList) { + v1_toleration_free(listEntry->data); + listEntry->data = NULL; + } + list_freeList(tolerationsList); + tolerationsList = NULL; + } return NULL; } diff --git a/kubernetes/model/v1_scope_selector.c b/kubernetes/model/v1_scope_selector.c index f374f3dc..cda1f3da 100644 --- a/kubernetes/model/v1_scope_selector.c +++ b/kubernetes/model/v1_scope_selector.c @@ -67,11 +67,13 @@ v1_scope_selector_t *v1_scope_selector_parseFromJSON(cJSON *v1_scope_selectorJSO v1_scope_selector_t *v1_scope_selector_local_var = NULL; + // define the local list for v1_scope_selector->match_expressions + list_t *match_expressionsList = NULL; + // v1_scope_selector->match_expressions cJSON *match_expressions = cJSON_GetObjectItemCaseSensitive(v1_scope_selectorJSON, "matchExpressions"); - list_t *match_expressionsList; if (match_expressions) { - cJSON *match_expressions_local_nonprimitive; + cJSON *match_expressions_local_nonprimitive = NULL; if(!cJSON_IsArray(match_expressions)){ goto end; //nonprimitive container } @@ -96,6 +98,15 @@ v1_scope_selector_t *v1_scope_selector_parseFromJSON(cJSON *v1_scope_selectorJSO return v1_scope_selector_local_var; end: + if (match_expressionsList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, match_expressionsList) { + v1_scoped_resource_selector_requirement_free(listEntry->data); + listEntry->data = NULL; + } + list_freeList(match_expressionsList); + match_expressionsList = NULL; + } return NULL; } diff --git a/kubernetes/model/v1_scoped_resource_selector_requirement.c b/kubernetes/model/v1_scoped_resource_selector_requirement.c index a6f86e17..d5a3f44a 100644 --- a/kubernetes/model/v1_scoped_resource_selector_requirement.c +++ b/kubernetes/model/v1_scoped_resource_selector_requirement.c @@ -96,6 +96,9 @@ v1_scoped_resource_selector_requirement_t *v1_scoped_resource_selector_requireme v1_scoped_resource_selector_requirement_t *v1_scoped_resource_selector_requirement_local_var = NULL; + // define the local list for v1_scoped_resource_selector_requirement->values + list_t *valuesList = NULL; + // v1_scoped_resource_selector_requirement->_operator cJSON *_operator = cJSON_GetObjectItemCaseSensitive(v1_scoped_resource_selector_requirementJSON, "operator"); if (!_operator) { @@ -122,9 +125,8 @@ v1_scoped_resource_selector_requirement_t *v1_scoped_resource_selector_requireme // v1_scoped_resource_selector_requirement->values cJSON *values = cJSON_GetObjectItemCaseSensitive(v1_scoped_resource_selector_requirementJSON, "values"); - list_t *valuesList; if (values) { - cJSON *values_local; + cJSON *values_local = NULL; if(!cJSON_IsArray(values)) { goto end;//primitive container } @@ -149,6 +151,15 @@ v1_scoped_resource_selector_requirement_t *v1_scoped_resource_selector_requireme return v1_scoped_resource_selector_requirement_local_var; end: + if (valuesList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, valuesList) { + free(listEntry->data); + listEntry->data = NULL; + } + list_freeList(valuesList); + valuesList = NULL; + } return NULL; } diff --git a/kubernetes/model/v1_secret.c b/kubernetes/model/v1_secret.c index 10d6754e..a2cbd645 100644 --- a/kubernetes/model/v1_secret.c +++ b/kubernetes/model/v1_secret.c @@ -173,9 +173,15 @@ v1_secret_t *v1_secret_parseFromJSON(cJSON *v1_secretJSON){ v1_secret_t *v1_secret_local_var = NULL; + // define the local map for v1_secret->data + list_t *dataList = NULL; + // define the local variable for v1_secret->metadata v1_object_meta_t *metadata_local_nonprim = NULL; + // define the local map for v1_secret->string_data + list_t *string_dataList = NULL; + // v1_secret->api_version cJSON *api_version = cJSON_GetObjectItemCaseSensitive(v1_secretJSON, "apiVersion"); if (api_version) { @@ -187,9 +193,8 @@ v1_secret_t *v1_secret_parseFromJSON(cJSON *v1_secretJSON){ // v1_secret->data cJSON *data = cJSON_GetObjectItemCaseSensitive(v1_secretJSON, "data"); - list_t *dataList; if (data) { - cJSON *data_local_map; + cJSON *data_local_map = NULL; if(!cJSON_IsObject(data)) { goto end;//primitive map container } @@ -233,9 +238,8 @@ v1_secret_t *v1_secret_parseFromJSON(cJSON *v1_secretJSON){ // v1_secret->string_data cJSON *string_data = cJSON_GetObjectItemCaseSensitive(v1_secretJSON, "stringData"); - list_t *string_dataList; if (string_data) { - cJSON *string_data_local_map; + cJSON *string_data_local_map = NULL; if(!cJSON_IsObject(string_data)) { goto end;//primitive map container } @@ -275,10 +279,38 @@ v1_secret_t *v1_secret_parseFromJSON(cJSON *v1_secretJSON){ return v1_secret_local_var; end: + if (dataList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, dataList) { + keyValuePair_t *localKeyValue = (keyValuePair_t*) listEntry->data; + free(localKeyValue->key); + localKeyValue->key = NULL; + free(localKeyValue->value); + localKeyValue->value = NULL; + keyValuePair_free(localKeyValue); + localKeyValue = NULL; + } + list_freeList(dataList); + dataList = NULL; + } if (metadata_local_nonprim) { v1_object_meta_free(metadata_local_nonprim); metadata_local_nonprim = NULL; } + if (string_dataList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, string_dataList) { + keyValuePair_t *localKeyValue = (keyValuePair_t*) listEntry->data; + free(localKeyValue->key); + localKeyValue->key = NULL; + free(localKeyValue->value); + localKeyValue->value = NULL; + keyValuePair_free(localKeyValue); + localKeyValue = NULL; + } + list_freeList(string_dataList); + string_dataList = NULL; + } return NULL; } diff --git a/kubernetes/model/v1_secret_list.c b/kubernetes/model/v1_secret_list.c index fc7ccaba..04710354 100644 --- a/kubernetes/model/v1_secret_list.c +++ b/kubernetes/model/v1_secret_list.c @@ -116,6 +116,9 @@ v1_secret_list_t *v1_secret_list_parseFromJSON(cJSON *v1_secret_listJSON){ v1_secret_list_t *v1_secret_list_local_var = NULL; + // define the local list for v1_secret_list->items + list_t *itemsList = NULL; + // define the local variable for v1_secret_list->metadata v1_list_meta_t *metadata_local_nonprim = NULL; @@ -134,9 +137,8 @@ v1_secret_list_t *v1_secret_list_parseFromJSON(cJSON *v1_secret_listJSON){ goto end; } - list_t *itemsList; - cJSON *items_local_nonprimitive; + cJSON *items_local_nonprimitive = NULL; if(!cJSON_IsArray(items)){ goto end; //nonprimitive container } @@ -178,6 +180,15 @@ v1_secret_list_t *v1_secret_list_parseFromJSON(cJSON *v1_secret_listJSON){ return v1_secret_list_local_var; end: + if (itemsList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, itemsList) { + v1_secret_free(listEntry->data); + listEntry->data = NULL; + } + list_freeList(itemsList); + itemsList = NULL; + } if (metadata_local_nonprim) { v1_list_meta_free(metadata_local_nonprim); metadata_local_nonprim = NULL; diff --git a/kubernetes/model/v1_secret_projection.c b/kubernetes/model/v1_secret_projection.c index 30565051..f4269e6e 100644 --- a/kubernetes/model/v1_secret_projection.c +++ b/kubernetes/model/v1_secret_projection.c @@ -91,11 +91,13 @@ v1_secret_projection_t *v1_secret_projection_parseFromJSON(cJSON *v1_secret_proj v1_secret_projection_t *v1_secret_projection_local_var = NULL; + // define the local list for v1_secret_projection->items + list_t *itemsList = NULL; + // v1_secret_projection->items cJSON *items = cJSON_GetObjectItemCaseSensitive(v1_secret_projectionJSON, "items"); - list_t *itemsList; if (items) { - cJSON *items_local_nonprimitive; + cJSON *items_local_nonprimitive = NULL; if(!cJSON_IsArray(items)){ goto end; //nonprimitive container } @@ -140,6 +142,15 @@ v1_secret_projection_t *v1_secret_projection_parseFromJSON(cJSON *v1_secret_proj return v1_secret_projection_local_var; end: + if (itemsList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, itemsList) { + v1_key_to_path_free(listEntry->data); + listEntry->data = NULL; + } + list_freeList(itemsList); + itemsList = NULL; + } return NULL; } diff --git a/kubernetes/model/v1_secret_volume_source.c b/kubernetes/model/v1_secret_volume_source.c index edc5e002..4ad37b63 100644 --- a/kubernetes/model/v1_secret_volume_source.c +++ b/kubernetes/model/v1_secret_volume_source.c @@ -101,6 +101,9 @@ v1_secret_volume_source_t *v1_secret_volume_source_parseFromJSON(cJSON *v1_secre v1_secret_volume_source_t *v1_secret_volume_source_local_var = NULL; + // define the local list for v1_secret_volume_source->items + list_t *itemsList = NULL; + // v1_secret_volume_source->default_mode cJSON *default_mode = cJSON_GetObjectItemCaseSensitive(v1_secret_volume_sourceJSON, "defaultMode"); if (default_mode) { @@ -112,9 +115,8 @@ v1_secret_volume_source_t *v1_secret_volume_source_parseFromJSON(cJSON *v1_secre // v1_secret_volume_source->items cJSON *items = cJSON_GetObjectItemCaseSensitive(v1_secret_volume_sourceJSON, "items"); - list_t *itemsList; if (items) { - cJSON *items_local_nonprimitive; + cJSON *items_local_nonprimitive = NULL; if(!cJSON_IsArray(items)){ goto end; //nonprimitive container } @@ -160,6 +162,15 @@ v1_secret_volume_source_t *v1_secret_volume_source_parseFromJSON(cJSON *v1_secre return v1_secret_volume_source_local_var; end: + if (itemsList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, itemsList) { + v1_key_to_path_free(listEntry->data); + listEntry->data = NULL; + } + list_freeList(itemsList); + itemsList = NULL; + } return NULL; } diff --git a/kubernetes/model/v1_service_account.c b/kubernetes/model/v1_service_account.c index e7e9c2a4..96e45c63 100644 --- a/kubernetes/model/v1_service_account.c +++ b/kubernetes/model/v1_service_account.c @@ -153,9 +153,15 @@ v1_service_account_t *v1_service_account_parseFromJSON(cJSON *v1_service_account v1_service_account_t *v1_service_account_local_var = NULL; + // define the local list for v1_service_account->image_pull_secrets + list_t *image_pull_secretsList = NULL; + // define the local variable for v1_service_account->metadata v1_object_meta_t *metadata_local_nonprim = NULL; + // define the local list for v1_service_account->secrets + list_t *secretsList = NULL; + // v1_service_account->api_version cJSON *api_version = cJSON_GetObjectItemCaseSensitive(v1_service_accountJSON, "apiVersion"); if (api_version) { @@ -176,9 +182,8 @@ v1_service_account_t *v1_service_account_parseFromJSON(cJSON *v1_service_account // v1_service_account->image_pull_secrets cJSON *image_pull_secrets = cJSON_GetObjectItemCaseSensitive(v1_service_accountJSON, "imagePullSecrets"); - list_t *image_pull_secretsList; if (image_pull_secrets) { - cJSON *image_pull_secrets_local_nonprimitive; + cJSON *image_pull_secrets_local_nonprimitive = NULL; if(!cJSON_IsArray(image_pull_secrets)){ goto end; //nonprimitive container } @@ -213,9 +218,8 @@ v1_service_account_t *v1_service_account_parseFromJSON(cJSON *v1_service_account // v1_service_account->secrets cJSON *secrets = cJSON_GetObjectItemCaseSensitive(v1_service_accountJSON, "secrets"); - list_t *secretsList; if (secrets) { - cJSON *secrets_local_nonprimitive; + cJSON *secrets_local_nonprimitive = NULL; if(!cJSON_IsArray(secrets)){ goto end; //nonprimitive container } @@ -245,10 +249,28 @@ v1_service_account_t *v1_service_account_parseFromJSON(cJSON *v1_service_account return v1_service_account_local_var; end: + if (image_pull_secretsList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, image_pull_secretsList) { + v1_local_object_reference_free(listEntry->data); + listEntry->data = NULL; + } + list_freeList(image_pull_secretsList); + image_pull_secretsList = NULL; + } if (metadata_local_nonprim) { v1_object_meta_free(metadata_local_nonprim); metadata_local_nonprim = NULL; } + if (secretsList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, secretsList) { + v1_object_reference_free(listEntry->data); + listEntry->data = NULL; + } + list_freeList(secretsList); + secretsList = NULL; + } return NULL; } diff --git a/kubernetes/model/v1_service_account_list.c b/kubernetes/model/v1_service_account_list.c index b3a056a0..12a6c693 100644 --- a/kubernetes/model/v1_service_account_list.c +++ b/kubernetes/model/v1_service_account_list.c @@ -116,6 +116,9 @@ v1_service_account_list_t *v1_service_account_list_parseFromJSON(cJSON *v1_servi v1_service_account_list_t *v1_service_account_list_local_var = NULL; + // define the local list for v1_service_account_list->items + list_t *itemsList = NULL; + // define the local variable for v1_service_account_list->metadata v1_list_meta_t *metadata_local_nonprim = NULL; @@ -134,9 +137,8 @@ v1_service_account_list_t *v1_service_account_list_parseFromJSON(cJSON *v1_servi goto end; } - list_t *itemsList; - cJSON *items_local_nonprimitive; + cJSON *items_local_nonprimitive = NULL; if(!cJSON_IsArray(items)){ goto end; //nonprimitive container } @@ -178,6 +180,15 @@ v1_service_account_list_t *v1_service_account_list_parseFromJSON(cJSON *v1_servi return v1_service_account_list_local_var; end: + if (itemsList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, itemsList) { + v1_service_account_free(listEntry->data); + listEntry->data = NULL; + } + list_freeList(itemsList); + itemsList = NULL; + } if (metadata_local_nonprim) { v1_list_meta_free(metadata_local_nonprim); metadata_local_nonprim = NULL; diff --git a/kubernetes/model/v1_service_list.c b/kubernetes/model/v1_service_list.c index 3c1a7254..10904a0b 100644 --- a/kubernetes/model/v1_service_list.c +++ b/kubernetes/model/v1_service_list.c @@ -116,6 +116,9 @@ v1_service_list_t *v1_service_list_parseFromJSON(cJSON *v1_service_listJSON){ v1_service_list_t *v1_service_list_local_var = NULL; + // define the local list for v1_service_list->items + list_t *itemsList = NULL; + // define the local variable for v1_service_list->metadata v1_list_meta_t *metadata_local_nonprim = NULL; @@ -134,9 +137,8 @@ v1_service_list_t *v1_service_list_parseFromJSON(cJSON *v1_service_listJSON){ goto end; } - list_t *itemsList; - cJSON *items_local_nonprimitive; + cJSON *items_local_nonprimitive = NULL; if(!cJSON_IsArray(items)){ goto end; //nonprimitive container } @@ -178,6 +180,15 @@ v1_service_list_t *v1_service_list_parseFromJSON(cJSON *v1_service_listJSON){ return v1_service_list_local_var; end: + if (itemsList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, itemsList) { + v1_service_free(listEntry->data); + listEntry->data = NULL; + } + list_freeList(itemsList); + itemsList = NULL; + } if (metadata_local_nonprim) { v1_list_meta_free(metadata_local_nonprim); metadata_local_nonprim = NULL; diff --git a/kubernetes/model/v1_service_spec.c b/kubernetes/model/v1_service_spec.c index e3ec79c7..ebe31b2b 100644 --- a/kubernetes/model/v1_service_spec.c +++ b/kubernetes/model/v1_service_spec.c @@ -378,6 +378,24 @@ v1_service_spec_t *v1_service_spec_parseFromJSON(cJSON *v1_service_specJSON){ v1_service_spec_t *v1_service_spec_local_var = NULL; + // define the local list for v1_service_spec->cluster_ips + list_t *cluster_ipsList = NULL; + + // define the local list for v1_service_spec->external_ips + list_t *external_ipsList = NULL; + + // define the local list for v1_service_spec->ip_families + list_t *ip_familiesList = NULL; + + // define the local list for v1_service_spec->load_balancer_source_ranges + list_t *load_balancer_source_rangesList = NULL; + + // define the local list for v1_service_spec->ports + list_t *portsList = NULL; + + // define the local map for v1_service_spec->selector + list_t *selectorList = NULL; + // define the local variable for v1_service_spec->session_affinity_config v1_session_affinity_config_t *session_affinity_config_local_nonprim = NULL; @@ -401,9 +419,8 @@ v1_service_spec_t *v1_service_spec_parseFromJSON(cJSON *v1_service_specJSON){ // v1_service_spec->cluster_ips cJSON *cluster_ips = cJSON_GetObjectItemCaseSensitive(v1_service_specJSON, "clusterIPs"); - list_t *cluster_ipsList; if (cluster_ips) { - cJSON *cluster_ips_local; + cJSON *cluster_ips_local = NULL; if(!cJSON_IsArray(cluster_ips)) { goto end;//primitive container } @@ -421,9 +438,8 @@ v1_service_spec_t *v1_service_spec_parseFromJSON(cJSON *v1_service_specJSON){ // v1_service_spec->external_ips cJSON *external_ips = cJSON_GetObjectItemCaseSensitive(v1_service_specJSON, "externalIPs"); - list_t *external_ipsList; if (external_ips) { - cJSON *external_ips_local; + cJSON *external_ips_local = NULL; if(!cJSON_IsArray(external_ips)) { goto end;//primitive container } @@ -477,9 +493,8 @@ v1_service_spec_t *v1_service_spec_parseFromJSON(cJSON *v1_service_specJSON){ // v1_service_spec->ip_families cJSON *ip_families = cJSON_GetObjectItemCaseSensitive(v1_service_specJSON, "ipFamilies"); - list_t *ip_familiesList; if (ip_families) { - cJSON *ip_families_local; + cJSON *ip_families_local = NULL; if(!cJSON_IsArray(ip_families)) { goto end;//primitive container } @@ -524,9 +539,8 @@ v1_service_spec_t *v1_service_spec_parseFromJSON(cJSON *v1_service_specJSON){ // v1_service_spec->load_balancer_source_ranges cJSON *load_balancer_source_ranges = cJSON_GetObjectItemCaseSensitive(v1_service_specJSON, "loadBalancerSourceRanges"); - list_t *load_balancer_source_rangesList; if (load_balancer_source_ranges) { - cJSON *load_balancer_source_ranges_local; + cJSON *load_balancer_source_ranges_local = NULL; if(!cJSON_IsArray(load_balancer_source_ranges)) { goto end;//primitive container } @@ -544,9 +558,8 @@ v1_service_spec_t *v1_service_spec_parseFromJSON(cJSON *v1_service_specJSON){ // v1_service_spec->ports cJSON *ports = cJSON_GetObjectItemCaseSensitive(v1_service_specJSON, "ports"); - list_t *portsList; if (ports) { - cJSON *ports_local_nonprimitive; + cJSON *ports_local_nonprimitive = NULL; if(!cJSON_IsArray(ports)){ goto end; //nonprimitive container } @@ -575,9 +588,8 @@ v1_service_spec_t *v1_service_spec_parseFromJSON(cJSON *v1_service_specJSON){ // v1_service_spec->selector cJSON *selector = cJSON_GetObjectItemCaseSensitive(v1_service_specJSON, "selector"); - list_t *selectorList; if (selector) { - cJSON *selector_local_map; + cJSON *selector_local_map = NULL; if(!cJSON_IsObject(selector)) { goto end;//primitive map container } @@ -644,6 +656,65 @@ v1_service_spec_t *v1_service_spec_parseFromJSON(cJSON *v1_service_specJSON){ return v1_service_spec_local_var; end: + if (cluster_ipsList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, cluster_ipsList) { + free(listEntry->data); + listEntry->data = NULL; + } + list_freeList(cluster_ipsList); + cluster_ipsList = NULL; + } + if (external_ipsList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, external_ipsList) { + free(listEntry->data); + listEntry->data = NULL; + } + list_freeList(external_ipsList); + external_ipsList = NULL; + } + if (ip_familiesList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, ip_familiesList) { + free(listEntry->data); + listEntry->data = NULL; + } + list_freeList(ip_familiesList); + ip_familiesList = NULL; + } + if (load_balancer_source_rangesList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, load_balancer_source_rangesList) { + free(listEntry->data); + listEntry->data = NULL; + } + list_freeList(load_balancer_source_rangesList); + load_balancer_source_rangesList = NULL; + } + if (portsList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, portsList) { + v1_service_port_free(listEntry->data); + listEntry->data = NULL; + } + list_freeList(portsList); + portsList = NULL; + } + if (selectorList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, selectorList) { + keyValuePair_t *localKeyValue = (keyValuePair_t*) listEntry->data; + free(localKeyValue->key); + localKeyValue->key = NULL; + free(localKeyValue->value); + localKeyValue->value = NULL; + keyValuePair_free(localKeyValue); + localKeyValue = NULL; + } + list_freeList(selectorList); + selectorList = NULL; + } if (session_affinity_config_local_nonprim) { v1_session_affinity_config_free(session_affinity_config_local_nonprim); session_affinity_config_local_nonprim = NULL; diff --git a/kubernetes/model/v1_service_status.c b/kubernetes/model/v1_service_status.c index ffd5557d..35777347 100644 --- a/kubernetes/model/v1_service_status.c +++ b/kubernetes/model/v1_service_status.c @@ -86,14 +86,16 @@ v1_service_status_t *v1_service_status_parseFromJSON(cJSON *v1_service_statusJSO v1_service_status_t *v1_service_status_local_var = NULL; + // define the local list for v1_service_status->conditions + list_t *conditionsList = NULL; + // define the local variable for v1_service_status->load_balancer v1_load_balancer_status_t *load_balancer_local_nonprim = NULL; // v1_service_status->conditions cJSON *conditions = cJSON_GetObjectItemCaseSensitive(v1_service_statusJSON, "conditions"); - list_t *conditionsList; if (conditions) { - cJSON *conditions_local_nonprimitive; + cJSON *conditions_local_nonprimitive = NULL; if(!cJSON_IsArray(conditions)){ goto end; //nonprimitive container } @@ -125,6 +127,15 @@ v1_service_status_t *v1_service_status_parseFromJSON(cJSON *v1_service_statusJSO return v1_service_status_local_var; end: + if (conditionsList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, conditionsList) { + v1_condition_free(listEntry->data); + listEntry->data = NULL; + } + list_freeList(conditionsList); + conditionsList = NULL; + } if (load_balancer_local_nonprim) { v1_load_balancer_status_free(load_balancer_local_nonprim); load_balancer_local_nonprim = NULL; diff --git a/kubernetes/model/v1_stateful_set_list.c b/kubernetes/model/v1_stateful_set_list.c index 3a027574..d3eb5933 100644 --- a/kubernetes/model/v1_stateful_set_list.c +++ b/kubernetes/model/v1_stateful_set_list.c @@ -116,6 +116,9 @@ v1_stateful_set_list_t *v1_stateful_set_list_parseFromJSON(cJSON *v1_stateful_se v1_stateful_set_list_t *v1_stateful_set_list_local_var = NULL; + // define the local list for v1_stateful_set_list->items + list_t *itemsList = NULL; + // define the local variable for v1_stateful_set_list->metadata v1_list_meta_t *metadata_local_nonprim = NULL; @@ -134,9 +137,8 @@ v1_stateful_set_list_t *v1_stateful_set_list_parseFromJSON(cJSON *v1_stateful_se goto end; } - list_t *itemsList; - cJSON *items_local_nonprimitive; + cJSON *items_local_nonprimitive = NULL; if(!cJSON_IsArray(items)){ goto end; //nonprimitive container } @@ -178,6 +180,15 @@ v1_stateful_set_list_t *v1_stateful_set_list_parseFromJSON(cJSON *v1_stateful_se return v1_stateful_set_list_local_var; end: + if (itemsList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, itemsList) { + v1_stateful_set_free(listEntry->data); + listEntry->data = NULL; + } + list_freeList(itemsList); + itemsList = NULL; + } if (metadata_local_nonprim) { v1_list_meta_free(metadata_local_nonprim); metadata_local_nonprim = NULL; diff --git a/kubernetes/model/v1_stateful_set_spec.c b/kubernetes/model/v1_stateful_set_spec.c index d3ed2514..c53b76a3 100644 --- a/kubernetes/model/v1_stateful_set_spec.c +++ b/kubernetes/model/v1_stateful_set_spec.c @@ -197,6 +197,9 @@ v1_stateful_set_spec_t *v1_stateful_set_spec_parseFromJSON(cJSON *v1_stateful_se // define the local variable for v1_stateful_set_spec->update_strategy v1_stateful_set_update_strategy_t *update_strategy_local_nonprim = NULL; + // define the local list for v1_stateful_set_spec->volume_claim_templates + list_t *volume_claim_templatesList = NULL; + // v1_stateful_set_spec->min_ready_seconds cJSON *min_ready_seconds = cJSON_GetObjectItemCaseSensitive(v1_stateful_set_specJSON, "minReadySeconds"); if (min_ready_seconds) { @@ -271,9 +274,8 @@ v1_stateful_set_spec_t *v1_stateful_set_spec_parseFromJSON(cJSON *v1_stateful_se // v1_stateful_set_spec->volume_claim_templates cJSON *volume_claim_templates = cJSON_GetObjectItemCaseSensitive(v1_stateful_set_specJSON, "volumeClaimTemplates"); - list_t *volume_claim_templatesList; if (volume_claim_templates) { - cJSON *volume_claim_templates_local_nonprimitive; + cJSON *volume_claim_templates_local_nonprimitive = NULL; if(!cJSON_IsArray(volume_claim_templates)){ goto end; //nonprimitive container } @@ -318,6 +320,15 @@ v1_stateful_set_spec_t *v1_stateful_set_spec_parseFromJSON(cJSON *v1_stateful_se v1_stateful_set_update_strategy_free(update_strategy_local_nonprim); update_strategy_local_nonprim = NULL; } + if (volume_claim_templatesList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, volume_claim_templatesList) { + v1_persistent_volume_claim_free(listEntry->data); + listEntry->data = NULL; + } + list_freeList(volume_claim_templatesList); + volume_claim_templatesList = NULL; + } return NULL; } diff --git a/kubernetes/model/v1_stateful_set_status.c b/kubernetes/model/v1_stateful_set_status.c index ee83a90a..d73c7466 100644 --- a/kubernetes/model/v1_stateful_set_status.c +++ b/kubernetes/model/v1_stateful_set_status.c @@ -167,6 +167,9 @@ v1_stateful_set_status_t *v1_stateful_set_status_parseFromJSON(cJSON *v1_statefu v1_stateful_set_status_t *v1_stateful_set_status_local_var = NULL; + // define the local list for v1_stateful_set_status->conditions + list_t *conditionsList = NULL; + // v1_stateful_set_status->available_replicas cJSON *available_replicas = cJSON_GetObjectItemCaseSensitive(v1_stateful_set_statusJSON, "availableReplicas"); if (available_replicas) { @@ -187,9 +190,8 @@ v1_stateful_set_status_t *v1_stateful_set_status_parseFromJSON(cJSON *v1_statefu // v1_stateful_set_status->conditions cJSON *conditions = cJSON_GetObjectItemCaseSensitive(v1_stateful_set_statusJSON, "conditions"); - list_t *conditionsList; if (conditions) { - cJSON *conditions_local_nonprimitive; + cJSON *conditions_local_nonprimitive = NULL; if(!cJSON_IsArray(conditions)){ goto end; //nonprimitive container } @@ -289,6 +291,15 @@ v1_stateful_set_status_t *v1_stateful_set_status_parseFromJSON(cJSON *v1_statefu return v1_stateful_set_status_local_var; end: + if (conditionsList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, conditionsList) { + v1_stateful_set_condition_free(listEntry->data); + listEntry->data = NULL; + } + list_freeList(conditionsList); + conditionsList = NULL; + } return NULL; } diff --git a/kubernetes/model/v1_status_details.c b/kubernetes/model/v1_status_details.c index 591e9f8b..9e04081a 100644 --- a/kubernetes/model/v1_status_details.c +++ b/kubernetes/model/v1_status_details.c @@ -133,11 +133,13 @@ v1_status_details_t *v1_status_details_parseFromJSON(cJSON *v1_status_detailsJSO v1_status_details_t *v1_status_details_local_var = NULL; + // define the local list for v1_status_details->causes + list_t *causesList = NULL; + // v1_status_details->causes cJSON *causes = cJSON_GetObjectItemCaseSensitive(v1_status_detailsJSON, "causes"); - list_t *causesList; if (causes) { - cJSON *causes_local_nonprimitive; + cJSON *causes_local_nonprimitive = NULL; if(!cJSON_IsArray(causes)){ goto end; //nonprimitive container } @@ -212,6 +214,15 @@ v1_status_details_t *v1_status_details_parseFromJSON(cJSON *v1_status_detailsJSO return v1_status_details_local_var; end: + if (causesList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, causesList) { + v1_status_cause_free(listEntry->data); + listEntry->data = NULL; + } + list_freeList(causesList); + causesList = NULL; + } return NULL; } diff --git a/kubernetes/model/v1_storage_class.c b/kubernetes/model/v1_storage_class.c index b9666d83..592a8ec5 100644 --- a/kubernetes/model/v1_storage_class.c +++ b/kubernetes/model/v1_storage_class.c @@ -226,9 +226,18 @@ v1_storage_class_t *v1_storage_class_parseFromJSON(cJSON *v1_storage_classJSON){ v1_storage_class_t *v1_storage_class_local_var = NULL; + // define the local list for v1_storage_class->allowed_topologies + list_t *allowed_topologiesList = NULL; + // define the local variable for v1_storage_class->metadata v1_object_meta_t *metadata_local_nonprim = NULL; + // define the local list for v1_storage_class->mount_options + list_t *mount_optionsList = NULL; + + // define the local map for v1_storage_class->parameters + list_t *parametersList = NULL; + // v1_storage_class->allow_volume_expansion cJSON *allow_volume_expansion = cJSON_GetObjectItemCaseSensitive(v1_storage_classJSON, "allowVolumeExpansion"); if (allow_volume_expansion) { @@ -240,9 +249,8 @@ v1_storage_class_t *v1_storage_class_parseFromJSON(cJSON *v1_storage_classJSON){ // v1_storage_class->allowed_topologies cJSON *allowed_topologies = cJSON_GetObjectItemCaseSensitive(v1_storage_classJSON, "allowedTopologies"); - list_t *allowed_topologiesList; if (allowed_topologies) { - cJSON *allowed_topologies_local_nonprimitive; + cJSON *allowed_topologies_local_nonprimitive = NULL; if(!cJSON_IsArray(allowed_topologies)){ goto end; //nonprimitive container } @@ -286,9 +294,8 @@ v1_storage_class_t *v1_storage_class_parseFromJSON(cJSON *v1_storage_classJSON){ // v1_storage_class->mount_options cJSON *mount_options = cJSON_GetObjectItemCaseSensitive(v1_storage_classJSON, "mountOptions"); - list_t *mount_optionsList; if (mount_options) { - cJSON *mount_options_local; + cJSON *mount_options_local = NULL; if(!cJSON_IsArray(mount_options)) { goto end;//primitive container } @@ -306,9 +313,8 @@ v1_storage_class_t *v1_storage_class_parseFromJSON(cJSON *v1_storage_classJSON){ // v1_storage_class->parameters cJSON *parameters = cJSON_GetObjectItemCaseSensitive(v1_storage_classJSON, "parameters"); - list_t *parametersList; if (parameters) { - cJSON *parameters_local_map; + cJSON *parameters_local_map = NULL; if(!cJSON_IsObject(parameters)) { goto end;//primitive map container } @@ -372,10 +378,42 @@ v1_storage_class_t *v1_storage_class_parseFromJSON(cJSON *v1_storage_classJSON){ return v1_storage_class_local_var; end: + if (allowed_topologiesList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, allowed_topologiesList) { + v1_topology_selector_term_free(listEntry->data); + listEntry->data = NULL; + } + list_freeList(allowed_topologiesList); + allowed_topologiesList = NULL; + } if (metadata_local_nonprim) { v1_object_meta_free(metadata_local_nonprim); metadata_local_nonprim = NULL; } + if (mount_optionsList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, mount_optionsList) { + free(listEntry->data); + listEntry->data = NULL; + } + list_freeList(mount_optionsList); + mount_optionsList = NULL; + } + if (parametersList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, parametersList) { + keyValuePair_t *localKeyValue = (keyValuePair_t*) listEntry->data; + free(localKeyValue->key); + localKeyValue->key = NULL; + free(localKeyValue->value); + localKeyValue->value = NULL; + keyValuePair_free(localKeyValue); + localKeyValue = NULL; + } + list_freeList(parametersList); + parametersList = NULL; + } return NULL; } diff --git a/kubernetes/model/v1_storage_class_list.c b/kubernetes/model/v1_storage_class_list.c index 92387b21..109df750 100644 --- a/kubernetes/model/v1_storage_class_list.c +++ b/kubernetes/model/v1_storage_class_list.c @@ -116,6 +116,9 @@ v1_storage_class_list_t *v1_storage_class_list_parseFromJSON(cJSON *v1_storage_c v1_storage_class_list_t *v1_storage_class_list_local_var = NULL; + // define the local list for v1_storage_class_list->items + list_t *itemsList = NULL; + // define the local variable for v1_storage_class_list->metadata v1_list_meta_t *metadata_local_nonprim = NULL; @@ -134,9 +137,8 @@ v1_storage_class_list_t *v1_storage_class_list_parseFromJSON(cJSON *v1_storage_c goto end; } - list_t *itemsList; - cJSON *items_local_nonprimitive; + cJSON *items_local_nonprimitive = NULL; if(!cJSON_IsArray(items)){ goto end; //nonprimitive container } @@ -178,6 +180,15 @@ v1_storage_class_list_t *v1_storage_class_list_parseFromJSON(cJSON *v1_storage_c return v1_storage_class_list_local_var; end: + if (itemsList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, itemsList) { + v1_storage_class_free(listEntry->data); + listEntry->data = NULL; + } + list_freeList(itemsList); + itemsList = NULL; + } if (metadata_local_nonprim) { v1_list_meta_free(metadata_local_nonprim); metadata_local_nonprim = NULL; diff --git a/kubernetes/model/v1_subject_access_review_spec.c b/kubernetes/model/v1_subject_access_review_spec.c index 60003960..5d2d38c9 100644 --- a/kubernetes/model/v1_subject_access_review_spec.c +++ b/kubernetes/model/v1_subject_access_review_spec.c @@ -158,6 +158,12 @@ v1_subject_access_review_spec_t *v1_subject_access_review_spec_parseFromJSON(cJS v1_subject_access_review_spec_t *v1_subject_access_review_spec_local_var = NULL; + // define the local map for v1_subject_access_review_spec->extra + list_t *extraList = NULL; + + // define the local list for v1_subject_access_review_spec->groups + list_t *groupsList = NULL; + // define the local variable for v1_subject_access_review_spec->non_resource_attributes v1_non_resource_attributes_t *non_resource_attributes_local_nonprim = NULL; @@ -166,9 +172,8 @@ v1_subject_access_review_spec_t *v1_subject_access_review_spec_parseFromJSON(cJS // v1_subject_access_review_spec->extra cJSON *extra = cJSON_GetObjectItemCaseSensitive(v1_subject_access_review_specJSON, "extra"); - list_t *extraList; if (extra) { - cJSON *extra_local_map; + cJSON *extra_local_map = NULL; if(!cJSON_IsObject(extra)) { goto end;//primitive map container } @@ -183,9 +188,8 @@ v1_subject_access_review_spec_t *v1_subject_access_review_spec_parseFromJSON(cJS // v1_subject_access_review_spec->groups cJSON *groups = cJSON_GetObjectItemCaseSensitive(v1_subject_access_review_specJSON, "groups"); - list_t *groupsList; if (groups) { - cJSON *groups_local; + cJSON *groups_local = NULL; if(!cJSON_IsArray(groups)) { goto end;//primitive container } @@ -243,6 +247,27 @@ v1_subject_access_review_spec_t *v1_subject_access_review_spec_parseFromJSON(cJS return v1_subject_access_review_spec_local_var; end: + if (extraList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, extraList) { + keyValuePair_t *localKeyValue = (keyValuePair_t*) listEntry->data; + free(localKeyValue->key); + localKeyValue->key = NULL; + keyValuePair_free(localKeyValue); + localKeyValue = NULL; + } + list_freeList(extraList); + extraList = NULL; + } + if (groupsList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, groupsList) { + free(listEntry->data); + listEntry->data = NULL; + } + list_freeList(groupsList); + groupsList = NULL; + } if (non_resource_attributes_local_nonprim) { v1_non_resource_attributes_free(non_resource_attributes_local_nonprim); non_resource_attributes_local_nonprim = NULL; diff --git a/kubernetes/model/v1_subject_rules_review_status.c b/kubernetes/model/v1_subject_rules_review_status.c index ff3dec53..656d1a72 100644 --- a/kubernetes/model/v1_subject_rules_review_status.c +++ b/kubernetes/model/v1_subject_rules_review_status.c @@ -126,6 +126,12 @@ v1_subject_rules_review_status_t *v1_subject_rules_review_status_parseFromJSON(c v1_subject_rules_review_status_t *v1_subject_rules_review_status_local_var = NULL; + // define the local list for v1_subject_rules_review_status->non_resource_rules + list_t *non_resource_rulesList = NULL; + + // define the local list for v1_subject_rules_review_status->resource_rules + list_t *resource_rulesList = NULL; + // v1_subject_rules_review_status->evaluation_error cJSON *evaluation_error = cJSON_GetObjectItemCaseSensitive(v1_subject_rules_review_statusJSON, "evaluationError"); if (evaluation_error) { @@ -153,9 +159,8 @@ v1_subject_rules_review_status_t *v1_subject_rules_review_status_parseFromJSON(c goto end; } - list_t *non_resource_rulesList; - cJSON *non_resource_rules_local_nonprimitive; + cJSON *non_resource_rules_local_nonprimitive = NULL; if(!cJSON_IsArray(non_resource_rules)){ goto end; //nonprimitive container } @@ -178,9 +183,8 @@ v1_subject_rules_review_status_t *v1_subject_rules_review_status_parseFromJSON(c goto end; } - list_t *resource_rulesList; - cJSON *resource_rules_local_nonprimitive; + cJSON *resource_rules_local_nonprimitive = NULL; if(!cJSON_IsArray(resource_rules)){ goto end; //nonprimitive container } @@ -207,6 +211,24 @@ v1_subject_rules_review_status_t *v1_subject_rules_review_status_parseFromJSON(c return v1_subject_rules_review_status_local_var; end: + if (non_resource_rulesList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, non_resource_rulesList) { + v1_non_resource_rule_free(listEntry->data); + listEntry->data = NULL; + } + list_freeList(non_resource_rulesList); + non_resource_rulesList = NULL; + } + if (resource_rulesList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, resource_rulesList) { + v1_resource_rule_free(listEntry->data); + listEntry->data = NULL; + } + list_freeList(resource_rulesList); + resource_rulesList = NULL; + } return NULL; } diff --git a/kubernetes/model/v1_token_request_spec.c b/kubernetes/model/v1_token_request_spec.c index 3e1f9949..6213e3ec 100644 --- a/kubernetes/model/v1_token_request_spec.c +++ b/kubernetes/model/v1_token_request_spec.c @@ -95,6 +95,9 @@ v1_token_request_spec_t *v1_token_request_spec_parseFromJSON(cJSON *v1_token_req v1_token_request_spec_t *v1_token_request_spec_local_var = NULL; + // define the local list for v1_token_request_spec->audiences + list_t *audiencesList = NULL; + // define the local variable for v1_token_request_spec->bound_object_ref v1_bound_object_reference_t *bound_object_ref_local_nonprim = NULL; @@ -104,9 +107,8 @@ v1_token_request_spec_t *v1_token_request_spec_parseFromJSON(cJSON *v1_token_req goto end; } - list_t *audiencesList; - cJSON *audiences_local; + cJSON *audiences_local = NULL; if(!cJSON_IsArray(audiences)) { goto end;//primitive container } @@ -145,6 +147,15 @@ v1_token_request_spec_t *v1_token_request_spec_parseFromJSON(cJSON *v1_token_req return v1_token_request_spec_local_var; end: + if (audiencesList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, audiencesList) { + free(listEntry->data); + listEntry->data = NULL; + } + list_freeList(audiencesList); + audiencesList = NULL; + } if (bound_object_ref_local_nonprim) { v1_bound_object_reference_free(bound_object_ref_local_nonprim); bound_object_ref_local_nonprim = NULL; diff --git a/kubernetes/model/v1_token_review_spec.c b/kubernetes/model/v1_token_review_spec.c index 2d949d04..c26fe4e1 100644 --- a/kubernetes/model/v1_token_review_spec.c +++ b/kubernetes/model/v1_token_review_spec.c @@ -78,11 +78,13 @@ v1_token_review_spec_t *v1_token_review_spec_parseFromJSON(cJSON *v1_token_revie v1_token_review_spec_t *v1_token_review_spec_local_var = NULL; + // define the local list for v1_token_review_spec->audiences + list_t *audiencesList = NULL; + // v1_token_review_spec->audiences cJSON *audiences = cJSON_GetObjectItemCaseSensitive(v1_token_review_specJSON, "audiences"); - list_t *audiencesList; if (audiences) { - cJSON *audiences_local; + cJSON *audiences_local = NULL; if(!cJSON_IsArray(audiences)) { goto end;//primitive container } @@ -115,6 +117,15 @@ v1_token_review_spec_t *v1_token_review_spec_parseFromJSON(cJSON *v1_token_revie return v1_token_review_spec_local_var; end: + if (audiencesList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, audiencesList) { + free(listEntry->data); + listEntry->data = NULL; + } + list_freeList(audiencesList); + audiencesList = NULL; + } return NULL; } diff --git a/kubernetes/model/v1_token_review_status.c b/kubernetes/model/v1_token_review_status.c index 4e552b7d..27997350 100644 --- a/kubernetes/model/v1_token_review_status.c +++ b/kubernetes/model/v1_token_review_status.c @@ -107,14 +107,16 @@ v1_token_review_status_t *v1_token_review_status_parseFromJSON(cJSON *v1_token_r v1_token_review_status_t *v1_token_review_status_local_var = NULL; + // define the local list for v1_token_review_status->audiences + list_t *audiencesList = NULL; + // define the local variable for v1_token_review_status->user v1_user_info_t *user_local_nonprim = NULL; // v1_token_review_status->audiences cJSON *audiences = cJSON_GetObjectItemCaseSensitive(v1_token_review_statusJSON, "audiences"); - list_t *audiencesList; if (audiences) { - cJSON *audiences_local; + cJSON *audiences_local = NULL; if(!cJSON_IsArray(audiences)) { goto end;//primitive container } @@ -164,6 +166,15 @@ v1_token_review_status_t *v1_token_review_status_parseFromJSON(cJSON *v1_token_r return v1_token_review_status_local_var; end: + if (audiencesList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, audiencesList) { + free(listEntry->data); + listEntry->data = NULL; + } + list_freeList(audiencesList); + audiencesList = NULL; + } if (user_local_nonprim) { v1_user_info_free(user_local_nonprim); user_local_nonprim = NULL; diff --git a/kubernetes/model/v1_topology_selector_label_requirement.c b/kubernetes/model/v1_topology_selector_label_requirement.c index 9d56e5b7..8898de98 100644 --- a/kubernetes/model/v1_topology_selector_label_requirement.c +++ b/kubernetes/model/v1_topology_selector_label_requirement.c @@ -82,6 +82,9 @@ v1_topology_selector_label_requirement_t *v1_topology_selector_label_requirement v1_topology_selector_label_requirement_t *v1_topology_selector_label_requirement_local_var = NULL; + // define the local list for v1_topology_selector_label_requirement->values + list_t *valuesList = NULL; + // v1_topology_selector_label_requirement->key cJSON *key = cJSON_GetObjectItemCaseSensitive(v1_topology_selector_label_requirementJSON, "key"); if (!key) { @@ -100,9 +103,8 @@ v1_topology_selector_label_requirement_t *v1_topology_selector_label_requirement goto end; } - list_t *valuesList; - cJSON *values_local; + cJSON *values_local = NULL; if(!cJSON_IsArray(values)) { goto end;//primitive container } @@ -125,6 +127,15 @@ v1_topology_selector_label_requirement_t *v1_topology_selector_label_requirement return v1_topology_selector_label_requirement_local_var; end: + if (valuesList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, valuesList) { + free(listEntry->data); + listEntry->data = NULL; + } + list_freeList(valuesList); + valuesList = NULL; + } return NULL; } diff --git a/kubernetes/model/v1_topology_selector_term.c b/kubernetes/model/v1_topology_selector_term.c index 12e0c064..934a35fb 100644 --- a/kubernetes/model/v1_topology_selector_term.c +++ b/kubernetes/model/v1_topology_selector_term.c @@ -67,11 +67,13 @@ v1_topology_selector_term_t *v1_topology_selector_term_parseFromJSON(cJSON *v1_t v1_topology_selector_term_t *v1_topology_selector_term_local_var = NULL; + // define the local list for v1_topology_selector_term->match_label_expressions + list_t *match_label_expressionsList = NULL; + // v1_topology_selector_term->match_label_expressions cJSON *match_label_expressions = cJSON_GetObjectItemCaseSensitive(v1_topology_selector_termJSON, "matchLabelExpressions"); - list_t *match_label_expressionsList; if (match_label_expressions) { - cJSON *match_label_expressions_local_nonprimitive; + cJSON *match_label_expressions_local_nonprimitive = NULL; if(!cJSON_IsArray(match_label_expressions)){ goto end; //nonprimitive container } @@ -96,6 +98,15 @@ v1_topology_selector_term_t *v1_topology_selector_term_parseFromJSON(cJSON *v1_t return v1_topology_selector_term_local_var; end: + if (match_label_expressionsList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, match_label_expressionsList) { + v1_topology_selector_label_requirement_free(listEntry->data); + listEntry->data = NULL; + } + list_freeList(match_label_expressionsList); + match_label_expressionsList = NULL; + } return NULL; } diff --git a/kubernetes/model/v1_uncounted_terminated_pods.c b/kubernetes/model/v1_uncounted_terminated_pods.c index 05d133bb..0e981fc0 100644 --- a/kubernetes/model/v1_uncounted_terminated_pods.c +++ b/kubernetes/model/v1_uncounted_terminated_pods.c @@ -90,11 +90,16 @@ v1_uncounted_terminated_pods_t *v1_uncounted_terminated_pods_parseFromJSON(cJSON v1_uncounted_terminated_pods_t *v1_uncounted_terminated_pods_local_var = NULL; + // define the local list for v1_uncounted_terminated_pods->failed + list_t *failedList = NULL; + + // define the local list for v1_uncounted_terminated_pods->succeeded + list_t *succeededList = NULL; + // v1_uncounted_terminated_pods->failed cJSON *failed = cJSON_GetObjectItemCaseSensitive(v1_uncounted_terminated_podsJSON, "failed"); - list_t *failedList; if (failed) { - cJSON *failed_local; + cJSON *failed_local = NULL; if(!cJSON_IsArray(failed)) { goto end;//primitive container } @@ -112,9 +117,8 @@ v1_uncounted_terminated_pods_t *v1_uncounted_terminated_pods_parseFromJSON(cJSON // v1_uncounted_terminated_pods->succeeded cJSON *succeeded = cJSON_GetObjectItemCaseSensitive(v1_uncounted_terminated_podsJSON, "succeeded"); - list_t *succeededList; if (succeeded) { - cJSON *succeeded_local; + cJSON *succeeded_local = NULL; if(!cJSON_IsArray(succeeded)) { goto end;//primitive container } @@ -138,6 +142,24 @@ v1_uncounted_terminated_pods_t *v1_uncounted_terminated_pods_parseFromJSON(cJSON return v1_uncounted_terminated_pods_local_var; end: + if (failedList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, failedList) { + free(listEntry->data); + listEntry->data = NULL; + } + list_freeList(failedList); + failedList = NULL; + } + if (succeededList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, succeededList) { + free(listEntry->data); + listEntry->data = NULL; + } + list_freeList(succeededList); + succeededList = NULL; + } return NULL; } diff --git a/kubernetes/model/v1_user_info.c b/kubernetes/model/v1_user_info.c index e28e8df3..421373ae 100644 --- a/kubernetes/model/v1_user_info.c +++ b/kubernetes/model/v1_user_info.c @@ -120,11 +120,16 @@ v1_user_info_t *v1_user_info_parseFromJSON(cJSON *v1_user_infoJSON){ v1_user_info_t *v1_user_info_local_var = NULL; + // define the local map for v1_user_info->extra + list_t *extraList = NULL; + + // define the local list for v1_user_info->groups + list_t *groupsList = NULL; + // v1_user_info->extra cJSON *extra = cJSON_GetObjectItemCaseSensitive(v1_user_infoJSON, "extra"); - list_t *extraList; if (extra) { - cJSON *extra_local_map; + cJSON *extra_local_map = NULL; if(!cJSON_IsObject(extra)) { goto end;//primitive map container } @@ -139,9 +144,8 @@ v1_user_info_t *v1_user_info_parseFromJSON(cJSON *v1_user_infoJSON){ // v1_user_info->groups cJSON *groups = cJSON_GetObjectItemCaseSensitive(v1_user_infoJSON, "groups"); - list_t *groupsList; if (groups) { - cJSON *groups_local; + cJSON *groups_local = NULL; if(!cJSON_IsArray(groups)) { goto end;//primitive container } @@ -185,6 +189,27 @@ v1_user_info_t *v1_user_info_parseFromJSON(cJSON *v1_user_infoJSON){ return v1_user_info_local_var; end: + if (extraList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, extraList) { + keyValuePair_t *localKeyValue = (keyValuePair_t*) listEntry->data; + free(localKeyValue->key); + localKeyValue->key = NULL; + keyValuePair_free(localKeyValue); + localKeyValue = NULL; + } + list_freeList(extraList); + extraList = NULL; + } + if (groupsList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, groupsList) { + free(listEntry->data); + listEntry->data = NULL; + } + list_freeList(groupsList); + groupsList = NULL; + } return NULL; } diff --git a/kubernetes/model/v1_validating_webhook.c b/kubernetes/model/v1_validating_webhook.c index 090337ba..fc481019 100644 --- a/kubernetes/model/v1_validating_webhook.c +++ b/kubernetes/model/v1_validating_webhook.c @@ -224,6 +224,9 @@ v1_validating_webhook_t *v1_validating_webhook_parseFromJSON(cJSON *v1_validatin v1_validating_webhook_t *v1_validating_webhook_local_var = NULL; + // define the local list for v1_validating_webhook->admission_review_versions + list_t *admission_review_versionsList = NULL; + // define the local variable for v1_validating_webhook->client_config admissionregistration_v1_webhook_client_config_t *client_config_local_nonprim = NULL; @@ -233,15 +236,17 @@ v1_validating_webhook_t *v1_validating_webhook_parseFromJSON(cJSON *v1_validatin // define the local variable for v1_validating_webhook->object_selector v1_label_selector_t *object_selector_local_nonprim = NULL; + // define the local list for v1_validating_webhook->rules + list_t *rulesList = NULL; + // v1_validating_webhook->admission_review_versions cJSON *admission_review_versions = cJSON_GetObjectItemCaseSensitive(v1_validating_webhookJSON, "admissionReviewVersions"); if (!admission_review_versions) { goto end; } - list_t *admission_review_versionsList; - cJSON *admission_review_versions_local; + cJSON *admission_review_versions_local = NULL; if(!cJSON_IsArray(admission_review_versions)) { goto end;//primitive container } @@ -309,9 +314,8 @@ v1_validating_webhook_t *v1_validating_webhook_parseFromJSON(cJSON *v1_validatin // v1_validating_webhook->rules cJSON *rules = cJSON_GetObjectItemCaseSensitive(v1_validating_webhookJSON, "rules"); - list_t *rulesList; if (rules) { - cJSON *rules_local_nonprimitive; + cJSON *rules_local_nonprimitive = NULL; if(!cJSON_IsArray(rules)){ goto end; //nonprimitive container } @@ -366,6 +370,15 @@ v1_validating_webhook_t *v1_validating_webhook_parseFromJSON(cJSON *v1_validatin return v1_validating_webhook_local_var; end: + if (admission_review_versionsList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, admission_review_versionsList) { + free(listEntry->data); + listEntry->data = NULL; + } + list_freeList(admission_review_versionsList); + admission_review_versionsList = NULL; + } if (client_config_local_nonprim) { admissionregistration_v1_webhook_client_config_free(client_config_local_nonprim); client_config_local_nonprim = NULL; @@ -378,6 +391,15 @@ v1_validating_webhook_t *v1_validating_webhook_parseFromJSON(cJSON *v1_validatin v1_label_selector_free(object_selector_local_nonprim); object_selector_local_nonprim = NULL; } + if (rulesList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, rulesList) { + v1_rule_with_operations_free(listEntry->data); + listEntry->data = NULL; + } + list_freeList(rulesList); + rulesList = NULL; + } return NULL; } diff --git a/kubernetes/model/v1_validating_webhook_configuration.c b/kubernetes/model/v1_validating_webhook_configuration.c index 96513441..e476db5b 100644 --- a/kubernetes/model/v1_validating_webhook_configuration.c +++ b/kubernetes/model/v1_validating_webhook_configuration.c @@ -117,6 +117,9 @@ v1_validating_webhook_configuration_t *v1_validating_webhook_configuration_parse // define the local variable for v1_validating_webhook_configuration->metadata v1_object_meta_t *metadata_local_nonprim = NULL; + // define the local list for v1_validating_webhook_configuration->webhooks + list_t *webhooksList = NULL; + // v1_validating_webhook_configuration->api_version cJSON *api_version = cJSON_GetObjectItemCaseSensitive(v1_validating_webhook_configurationJSON, "apiVersion"); if (api_version) { @@ -143,9 +146,8 @@ v1_validating_webhook_configuration_t *v1_validating_webhook_configuration_parse // v1_validating_webhook_configuration->webhooks cJSON *webhooks = cJSON_GetObjectItemCaseSensitive(v1_validating_webhook_configurationJSON, "webhooks"); - list_t *webhooksList; if (webhooks) { - cJSON *webhooks_local_nonprimitive; + cJSON *webhooks_local_nonprimitive = NULL; if(!cJSON_IsArray(webhooks)){ goto end; //nonprimitive container } @@ -177,6 +179,15 @@ v1_validating_webhook_configuration_t *v1_validating_webhook_configuration_parse v1_object_meta_free(metadata_local_nonprim); metadata_local_nonprim = NULL; } + if (webhooksList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, webhooksList) { + v1_validating_webhook_free(listEntry->data); + listEntry->data = NULL; + } + list_freeList(webhooksList); + webhooksList = NULL; + } return NULL; } diff --git a/kubernetes/model/v1_validating_webhook_configuration_list.c b/kubernetes/model/v1_validating_webhook_configuration_list.c index 5ae392df..1c49e4b3 100644 --- a/kubernetes/model/v1_validating_webhook_configuration_list.c +++ b/kubernetes/model/v1_validating_webhook_configuration_list.c @@ -116,6 +116,9 @@ v1_validating_webhook_configuration_list_t *v1_validating_webhook_configuration_ v1_validating_webhook_configuration_list_t *v1_validating_webhook_configuration_list_local_var = NULL; + // define the local list for v1_validating_webhook_configuration_list->items + list_t *itemsList = NULL; + // define the local variable for v1_validating_webhook_configuration_list->metadata v1_list_meta_t *metadata_local_nonprim = NULL; @@ -134,9 +137,8 @@ v1_validating_webhook_configuration_list_t *v1_validating_webhook_configuration_ goto end; } - list_t *itemsList; - cJSON *items_local_nonprimitive; + cJSON *items_local_nonprimitive = NULL; if(!cJSON_IsArray(items)){ goto end; //nonprimitive container } @@ -178,6 +180,15 @@ v1_validating_webhook_configuration_list_t *v1_validating_webhook_configuration_ return v1_validating_webhook_configuration_list_local_var; end: + if (itemsList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, itemsList) { + v1_validating_webhook_configuration_free(listEntry->data); + listEntry->data = NULL; + } + list_freeList(itemsList); + itemsList = NULL; + } if (metadata_local_nonprim) { v1_list_meta_free(metadata_local_nonprim); metadata_local_nonprim = NULL; diff --git a/kubernetes/model/v1_volume_attachment_list.c b/kubernetes/model/v1_volume_attachment_list.c index 0fa45697..f88c5523 100644 --- a/kubernetes/model/v1_volume_attachment_list.c +++ b/kubernetes/model/v1_volume_attachment_list.c @@ -116,6 +116,9 @@ v1_volume_attachment_list_t *v1_volume_attachment_list_parseFromJSON(cJSON *v1_v v1_volume_attachment_list_t *v1_volume_attachment_list_local_var = NULL; + // define the local list for v1_volume_attachment_list->items + list_t *itemsList = NULL; + // define the local variable for v1_volume_attachment_list->metadata v1_list_meta_t *metadata_local_nonprim = NULL; @@ -134,9 +137,8 @@ v1_volume_attachment_list_t *v1_volume_attachment_list_parseFromJSON(cJSON *v1_v goto end; } - list_t *itemsList; - cJSON *items_local_nonprimitive; + cJSON *items_local_nonprimitive = NULL; if(!cJSON_IsArray(items)){ goto end; //nonprimitive container } @@ -178,6 +180,15 @@ v1_volume_attachment_list_t *v1_volume_attachment_list_parseFromJSON(cJSON *v1_v return v1_volume_attachment_list_local_var; end: + if (itemsList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, itemsList) { + v1_volume_attachment_free(listEntry->data); + listEntry->data = NULL; + } + list_freeList(itemsList); + itemsList = NULL; + } if (metadata_local_nonprim) { v1_list_meta_free(metadata_local_nonprim); metadata_local_nonprim = NULL; diff --git a/kubernetes/model/v1_volume_attachment_status.c b/kubernetes/model/v1_volume_attachment_status.c index c5855368..58d2eb75 100644 --- a/kubernetes/model/v1_volume_attachment_status.c +++ b/kubernetes/model/v1_volume_attachment_status.c @@ -123,6 +123,9 @@ v1_volume_attachment_status_t *v1_volume_attachment_status_parseFromJSON(cJSON * // define the local variable for v1_volume_attachment_status->attach_error v1_volume_error_t *attach_error_local_nonprim = NULL; + // define the local map for v1_volume_attachment_status->attachment_metadata + list_t *attachment_metadataList = NULL; + // define the local variable for v1_volume_attachment_status->detach_error v1_volume_error_t *detach_error_local_nonprim = NULL; @@ -146,9 +149,8 @@ v1_volume_attachment_status_t *v1_volume_attachment_status_parseFromJSON(cJSON * // v1_volume_attachment_status->attachment_metadata cJSON *attachment_metadata = cJSON_GetObjectItemCaseSensitive(v1_volume_attachment_statusJSON, "attachmentMetadata"); - list_t *attachment_metadataList; if (attachment_metadata) { - cJSON *attachment_metadata_local_map; + cJSON *attachment_metadata_local_map = NULL; if(!cJSON_IsObject(attachment_metadata)) { goto end;//primitive map container } @@ -186,6 +188,20 @@ v1_volume_attachment_status_t *v1_volume_attachment_status_parseFromJSON(cJSON * v1_volume_error_free(attach_error_local_nonprim); attach_error_local_nonprim = NULL; } + if (attachment_metadataList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, attachment_metadataList) { + keyValuePair_t *localKeyValue = (keyValuePair_t*) listEntry->data; + free(localKeyValue->key); + localKeyValue->key = NULL; + free(localKeyValue->value); + localKeyValue->value = NULL; + keyValuePair_free(localKeyValue); + localKeyValue = NULL; + } + list_freeList(attachment_metadataList); + attachment_metadataList = NULL; + } if (detach_error_local_nonprim) { v1_volume_error_free(detach_error_local_nonprim); detach_error_local_nonprim = NULL; diff --git a/kubernetes/model/v1_webhook_conversion.c b/kubernetes/model/v1_webhook_conversion.c index 28cc9629..06f88deb 100644 --- a/kubernetes/model/v1_webhook_conversion.c +++ b/kubernetes/model/v1_webhook_conversion.c @@ -88,6 +88,9 @@ v1_webhook_conversion_t *v1_webhook_conversion_parseFromJSON(cJSON *v1_webhook_c // define the local variable for v1_webhook_conversion->client_config apiextensions_v1_webhook_client_config_t *client_config_local_nonprim = NULL; + // define the local list for v1_webhook_conversion->conversion_review_versions + list_t *conversion_review_versionsList = NULL; + // v1_webhook_conversion->client_config cJSON *client_config = cJSON_GetObjectItemCaseSensitive(v1_webhook_conversionJSON, "clientConfig"); if (client_config) { @@ -100,9 +103,8 @@ v1_webhook_conversion_t *v1_webhook_conversion_parseFromJSON(cJSON *v1_webhook_c goto end; } - list_t *conversion_review_versionsList; - cJSON *conversion_review_versions_local; + cJSON *conversion_review_versions_local = NULL; if(!cJSON_IsArray(conversion_review_versions)) { goto end;//primitive container } @@ -129,6 +131,15 @@ v1_webhook_conversion_t *v1_webhook_conversion_parseFromJSON(cJSON *v1_webhook_c apiextensions_v1_webhook_client_config_free(client_config_local_nonprim); client_config_local_nonprim = NULL; } + if (conversion_review_versionsList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, conversion_review_versionsList) { + free(listEntry->data); + listEntry->data = NULL; + } + list_freeList(conversion_review_versionsList); + conversion_review_versionsList = NULL; + } return NULL; } diff --git a/kubernetes/model/v1alpha1_aggregation_rule.c b/kubernetes/model/v1alpha1_aggregation_rule.c index 7b726f53..27f1ace2 100644 --- a/kubernetes/model/v1alpha1_aggregation_rule.c +++ b/kubernetes/model/v1alpha1_aggregation_rule.c @@ -67,11 +67,13 @@ v1alpha1_aggregation_rule_t *v1alpha1_aggregation_rule_parseFromJSON(cJSON *v1al v1alpha1_aggregation_rule_t *v1alpha1_aggregation_rule_local_var = NULL; + // define the local list for v1alpha1_aggregation_rule->cluster_role_selectors + list_t *cluster_role_selectorsList = NULL; + // v1alpha1_aggregation_rule->cluster_role_selectors cJSON *cluster_role_selectors = cJSON_GetObjectItemCaseSensitive(v1alpha1_aggregation_ruleJSON, "clusterRoleSelectors"); - list_t *cluster_role_selectorsList; if (cluster_role_selectors) { - cJSON *cluster_role_selectors_local_nonprimitive; + cJSON *cluster_role_selectors_local_nonprimitive = NULL; if(!cJSON_IsArray(cluster_role_selectors)){ goto end; //nonprimitive container } @@ -96,6 +98,15 @@ v1alpha1_aggregation_rule_t *v1alpha1_aggregation_rule_parseFromJSON(cJSON *v1al return v1alpha1_aggregation_rule_local_var; end: + if (cluster_role_selectorsList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, cluster_role_selectorsList) { + v1_label_selector_free(listEntry->data); + listEntry->data = NULL; + } + list_freeList(cluster_role_selectorsList); + cluster_role_selectorsList = NULL; + } return NULL; } diff --git a/kubernetes/model/v1alpha1_cluster_role.c b/kubernetes/model/v1alpha1_cluster_role.c index fa91bbb2..92a9b661 100644 --- a/kubernetes/model/v1alpha1_cluster_role.c +++ b/kubernetes/model/v1alpha1_cluster_role.c @@ -139,6 +139,9 @@ v1alpha1_cluster_role_t *v1alpha1_cluster_role_parseFromJSON(cJSON *v1alpha1_clu // define the local variable for v1alpha1_cluster_role->metadata v1_object_meta_t *metadata_local_nonprim = NULL; + // define the local list for v1alpha1_cluster_role->rules + list_t *rulesList = NULL; + // v1alpha1_cluster_role->aggregation_rule cJSON *aggregation_rule = cJSON_GetObjectItemCaseSensitive(v1alpha1_cluster_roleJSON, "aggregationRule"); if (aggregation_rule) { @@ -171,9 +174,8 @@ v1alpha1_cluster_role_t *v1alpha1_cluster_role_parseFromJSON(cJSON *v1alpha1_clu // v1alpha1_cluster_role->rules cJSON *rules = cJSON_GetObjectItemCaseSensitive(v1alpha1_cluster_roleJSON, "rules"); - list_t *rulesList; if (rules) { - cJSON *rules_local_nonprimitive; + cJSON *rules_local_nonprimitive = NULL; if(!cJSON_IsArray(rules)){ goto end; //nonprimitive container } @@ -210,6 +212,15 @@ v1alpha1_cluster_role_t *v1alpha1_cluster_role_parseFromJSON(cJSON *v1alpha1_clu v1_object_meta_free(metadata_local_nonprim); metadata_local_nonprim = NULL; } + if (rulesList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, rulesList) { + v1alpha1_policy_rule_free(listEntry->data); + listEntry->data = NULL; + } + list_freeList(rulesList); + rulesList = NULL; + } return NULL; } diff --git a/kubernetes/model/v1alpha1_cluster_role_binding.c b/kubernetes/model/v1alpha1_cluster_role_binding.c index 28288e32..9e6596c8 100644 --- a/kubernetes/model/v1alpha1_cluster_role_binding.c +++ b/kubernetes/model/v1alpha1_cluster_role_binding.c @@ -141,6 +141,9 @@ v1alpha1_cluster_role_binding_t *v1alpha1_cluster_role_binding_parseFromJSON(cJS // define the local variable for v1alpha1_cluster_role_binding->role_ref v1alpha1_role_ref_t *role_ref_local_nonprim = NULL; + // define the local list for v1alpha1_cluster_role_binding->subjects + list_t *subjectsList = NULL; + // v1alpha1_cluster_role_binding->api_version cJSON *api_version = cJSON_GetObjectItemCaseSensitive(v1alpha1_cluster_role_bindingJSON, "apiVersion"); if (api_version) { @@ -176,9 +179,8 @@ v1alpha1_cluster_role_binding_t *v1alpha1_cluster_role_binding_parseFromJSON(cJS // v1alpha1_cluster_role_binding->subjects cJSON *subjects = cJSON_GetObjectItemCaseSensitive(v1alpha1_cluster_role_bindingJSON, "subjects"); - list_t *subjectsList; if (subjects) { - cJSON *subjects_local_nonprimitive; + cJSON *subjects_local_nonprimitive = NULL; if(!cJSON_IsArray(subjects)){ goto end; //nonprimitive container } @@ -215,6 +217,15 @@ v1alpha1_cluster_role_binding_t *v1alpha1_cluster_role_binding_parseFromJSON(cJS v1alpha1_role_ref_free(role_ref_local_nonprim); role_ref_local_nonprim = NULL; } + if (subjectsList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, subjectsList) { + v1alpha1_subject_free(listEntry->data); + listEntry->data = NULL; + } + list_freeList(subjectsList); + subjectsList = NULL; + } return NULL; } diff --git a/kubernetes/model/v1alpha1_cluster_role_binding_list.c b/kubernetes/model/v1alpha1_cluster_role_binding_list.c index bf7b7bfd..b631a4d6 100644 --- a/kubernetes/model/v1alpha1_cluster_role_binding_list.c +++ b/kubernetes/model/v1alpha1_cluster_role_binding_list.c @@ -116,6 +116,9 @@ v1alpha1_cluster_role_binding_list_t *v1alpha1_cluster_role_binding_list_parseFr v1alpha1_cluster_role_binding_list_t *v1alpha1_cluster_role_binding_list_local_var = NULL; + // define the local list for v1alpha1_cluster_role_binding_list->items + list_t *itemsList = NULL; + // define the local variable for v1alpha1_cluster_role_binding_list->metadata v1_list_meta_t *metadata_local_nonprim = NULL; @@ -134,9 +137,8 @@ v1alpha1_cluster_role_binding_list_t *v1alpha1_cluster_role_binding_list_parseFr goto end; } - list_t *itemsList; - cJSON *items_local_nonprimitive; + cJSON *items_local_nonprimitive = NULL; if(!cJSON_IsArray(items)){ goto end; //nonprimitive container } @@ -178,6 +180,15 @@ v1alpha1_cluster_role_binding_list_t *v1alpha1_cluster_role_binding_list_parseFr return v1alpha1_cluster_role_binding_list_local_var; end: + if (itemsList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, itemsList) { + v1alpha1_cluster_role_binding_free(listEntry->data); + listEntry->data = NULL; + } + list_freeList(itemsList); + itemsList = NULL; + } if (metadata_local_nonprim) { v1_list_meta_free(metadata_local_nonprim); metadata_local_nonprim = NULL; diff --git a/kubernetes/model/v1alpha1_cluster_role_list.c b/kubernetes/model/v1alpha1_cluster_role_list.c index 6eea692d..5bb07ae6 100644 --- a/kubernetes/model/v1alpha1_cluster_role_list.c +++ b/kubernetes/model/v1alpha1_cluster_role_list.c @@ -116,6 +116,9 @@ v1alpha1_cluster_role_list_t *v1alpha1_cluster_role_list_parseFromJSON(cJSON *v1 v1alpha1_cluster_role_list_t *v1alpha1_cluster_role_list_local_var = NULL; + // define the local list for v1alpha1_cluster_role_list->items + list_t *itemsList = NULL; + // define the local variable for v1alpha1_cluster_role_list->metadata v1_list_meta_t *metadata_local_nonprim = NULL; @@ -134,9 +137,8 @@ v1alpha1_cluster_role_list_t *v1alpha1_cluster_role_list_parseFromJSON(cJSON *v1 goto end; } - list_t *itemsList; - cJSON *items_local_nonprimitive; + cJSON *items_local_nonprimitive = NULL; if(!cJSON_IsArray(items)){ goto end; //nonprimitive container } @@ -178,6 +180,15 @@ v1alpha1_cluster_role_list_t *v1alpha1_cluster_role_list_parseFromJSON(cJSON *v1 return v1alpha1_cluster_role_list_local_var; end: + if (itemsList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, itemsList) { + v1alpha1_cluster_role_free(listEntry->data); + listEntry->data = NULL; + } + list_freeList(itemsList); + itemsList = NULL; + } if (metadata_local_nonprim) { v1_list_meta_free(metadata_local_nonprim); metadata_local_nonprim = NULL; diff --git a/kubernetes/model/v1alpha1_csi_storage_capacity_list.c b/kubernetes/model/v1alpha1_csi_storage_capacity_list.c index b2c8aa0f..05085175 100644 --- a/kubernetes/model/v1alpha1_csi_storage_capacity_list.c +++ b/kubernetes/model/v1alpha1_csi_storage_capacity_list.c @@ -116,6 +116,9 @@ v1alpha1_csi_storage_capacity_list_t *v1alpha1_csi_storage_capacity_list_parseFr v1alpha1_csi_storage_capacity_list_t *v1alpha1_csi_storage_capacity_list_local_var = NULL; + // define the local list for v1alpha1_csi_storage_capacity_list->items + list_t *itemsList = NULL; + // define the local variable for v1alpha1_csi_storage_capacity_list->metadata v1_list_meta_t *metadata_local_nonprim = NULL; @@ -134,9 +137,8 @@ v1alpha1_csi_storage_capacity_list_t *v1alpha1_csi_storage_capacity_list_parseFr goto end; } - list_t *itemsList; - cJSON *items_local_nonprimitive; + cJSON *items_local_nonprimitive = NULL; if(!cJSON_IsArray(items)){ goto end; //nonprimitive container } @@ -178,6 +180,15 @@ v1alpha1_csi_storage_capacity_list_t *v1alpha1_csi_storage_capacity_list_parseFr return v1alpha1_csi_storage_capacity_list_local_var; end: + if (itemsList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, itemsList) { + v1alpha1_csi_storage_capacity_free(listEntry->data); + listEntry->data = NULL; + } + list_freeList(itemsList); + itemsList = NULL; + } if (metadata_local_nonprim) { v1_list_meta_free(metadata_local_nonprim); metadata_local_nonprim = NULL; diff --git a/kubernetes/model/v1alpha1_overhead.c b/kubernetes/model/v1alpha1_overhead.c index 95d27b05..e16eea9d 100644 --- a/kubernetes/model/v1alpha1_overhead.c +++ b/kubernetes/model/v1alpha1_overhead.c @@ -70,11 +70,13 @@ v1alpha1_overhead_t *v1alpha1_overhead_parseFromJSON(cJSON *v1alpha1_overheadJSO v1alpha1_overhead_t *v1alpha1_overhead_local_var = NULL; + // define the local map for v1alpha1_overhead->pod_fixed + list_t *pod_fixedList = NULL; + // v1alpha1_overhead->pod_fixed cJSON *pod_fixed = cJSON_GetObjectItemCaseSensitive(v1alpha1_overheadJSON, "podFixed"); - list_t *pod_fixedList; if (pod_fixed) { - cJSON *pod_fixed_local_map; + cJSON *pod_fixed_local_map = NULL; if(!cJSON_IsObject(pod_fixed)) { goto end;//primitive map container } @@ -99,6 +101,20 @@ v1alpha1_overhead_t *v1alpha1_overhead_parseFromJSON(cJSON *v1alpha1_overheadJSO return v1alpha1_overhead_local_var; end: + if (pod_fixedList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, pod_fixedList) { + keyValuePair_t *localKeyValue = (keyValuePair_t*) listEntry->data; + free(localKeyValue->key); + localKeyValue->key = NULL; + free(localKeyValue->value); + localKeyValue->value = NULL; + keyValuePair_free(localKeyValue); + localKeyValue = NULL; + } + list_freeList(pod_fixedList); + pod_fixedList = NULL; + } return NULL; } diff --git a/kubernetes/model/v1alpha1_policy_rule.c b/kubernetes/model/v1alpha1_policy_rule.c index 4f425e70..1e9d2124 100644 --- a/kubernetes/model/v1alpha1_policy_rule.c +++ b/kubernetes/model/v1alpha1_policy_rule.c @@ -170,11 +170,25 @@ v1alpha1_policy_rule_t *v1alpha1_policy_rule_parseFromJSON(cJSON *v1alpha1_polic v1alpha1_policy_rule_t *v1alpha1_policy_rule_local_var = NULL; + // define the local list for v1alpha1_policy_rule->api_groups + list_t *api_groupsList = NULL; + + // define the local list for v1alpha1_policy_rule->non_resource_urls + list_t *non_resource_urlsList = NULL; + + // define the local list for v1alpha1_policy_rule->resource_names + list_t *resource_namesList = NULL; + + // define the local list for v1alpha1_policy_rule->resources + list_t *resourcesList = NULL; + + // define the local list for v1alpha1_policy_rule->verbs + list_t *verbsList = NULL; + // v1alpha1_policy_rule->api_groups cJSON *api_groups = cJSON_GetObjectItemCaseSensitive(v1alpha1_policy_ruleJSON, "apiGroups"); - list_t *api_groupsList; if (api_groups) { - cJSON *api_groups_local; + cJSON *api_groups_local = NULL; if(!cJSON_IsArray(api_groups)) { goto end;//primitive container } @@ -192,9 +206,8 @@ v1alpha1_policy_rule_t *v1alpha1_policy_rule_parseFromJSON(cJSON *v1alpha1_polic // v1alpha1_policy_rule->non_resource_urls cJSON *non_resource_urls = cJSON_GetObjectItemCaseSensitive(v1alpha1_policy_ruleJSON, "nonResourceURLs"); - list_t *non_resource_urlsList; if (non_resource_urls) { - cJSON *non_resource_urls_local; + cJSON *non_resource_urls_local = NULL; if(!cJSON_IsArray(non_resource_urls)) { goto end;//primitive container } @@ -212,9 +225,8 @@ v1alpha1_policy_rule_t *v1alpha1_policy_rule_parseFromJSON(cJSON *v1alpha1_polic // v1alpha1_policy_rule->resource_names cJSON *resource_names = cJSON_GetObjectItemCaseSensitive(v1alpha1_policy_ruleJSON, "resourceNames"); - list_t *resource_namesList; if (resource_names) { - cJSON *resource_names_local; + cJSON *resource_names_local = NULL; if(!cJSON_IsArray(resource_names)) { goto end;//primitive container } @@ -232,9 +244,8 @@ v1alpha1_policy_rule_t *v1alpha1_policy_rule_parseFromJSON(cJSON *v1alpha1_polic // v1alpha1_policy_rule->resources cJSON *resources = cJSON_GetObjectItemCaseSensitive(v1alpha1_policy_ruleJSON, "resources"); - list_t *resourcesList; if (resources) { - cJSON *resources_local; + cJSON *resources_local = NULL; if(!cJSON_IsArray(resources)) { goto end;//primitive container } @@ -256,9 +267,8 @@ v1alpha1_policy_rule_t *v1alpha1_policy_rule_parseFromJSON(cJSON *v1alpha1_polic goto end; } - list_t *verbsList; - cJSON *verbs_local; + cJSON *verbs_local = NULL; if(!cJSON_IsArray(verbs)) { goto end;//primitive container } @@ -284,6 +294,51 @@ v1alpha1_policy_rule_t *v1alpha1_policy_rule_parseFromJSON(cJSON *v1alpha1_polic return v1alpha1_policy_rule_local_var; end: + if (api_groupsList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, api_groupsList) { + free(listEntry->data); + listEntry->data = NULL; + } + list_freeList(api_groupsList); + api_groupsList = NULL; + } + if (non_resource_urlsList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, non_resource_urlsList) { + free(listEntry->data); + listEntry->data = NULL; + } + list_freeList(non_resource_urlsList); + non_resource_urlsList = NULL; + } + if (resource_namesList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, resource_namesList) { + free(listEntry->data); + listEntry->data = NULL; + } + list_freeList(resource_namesList); + resource_namesList = NULL; + } + if (resourcesList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, resourcesList) { + free(listEntry->data); + listEntry->data = NULL; + } + list_freeList(resourcesList); + resourcesList = NULL; + } + if (verbsList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, verbsList) { + free(listEntry->data); + listEntry->data = NULL; + } + list_freeList(verbsList); + verbsList = NULL; + } return NULL; } diff --git a/kubernetes/model/v1alpha1_priority_class_list.c b/kubernetes/model/v1alpha1_priority_class_list.c index a6b30ef0..db113713 100644 --- a/kubernetes/model/v1alpha1_priority_class_list.c +++ b/kubernetes/model/v1alpha1_priority_class_list.c @@ -116,6 +116,9 @@ v1alpha1_priority_class_list_t *v1alpha1_priority_class_list_parseFromJSON(cJSON v1alpha1_priority_class_list_t *v1alpha1_priority_class_list_local_var = NULL; + // define the local list for v1alpha1_priority_class_list->items + list_t *itemsList = NULL; + // define the local variable for v1alpha1_priority_class_list->metadata v1_list_meta_t *metadata_local_nonprim = NULL; @@ -134,9 +137,8 @@ v1alpha1_priority_class_list_t *v1alpha1_priority_class_list_parseFromJSON(cJSON goto end; } - list_t *itemsList; - cJSON *items_local_nonprimitive; + cJSON *items_local_nonprimitive = NULL; if(!cJSON_IsArray(items)){ goto end; //nonprimitive container } @@ -178,6 +180,15 @@ v1alpha1_priority_class_list_t *v1alpha1_priority_class_list_parseFromJSON(cJSON return v1alpha1_priority_class_list_local_var; end: + if (itemsList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, itemsList) { + v1alpha1_priority_class_free(listEntry->data); + listEntry->data = NULL; + } + list_freeList(itemsList); + itemsList = NULL; + } if (metadata_local_nonprim) { v1_list_meta_free(metadata_local_nonprim); metadata_local_nonprim = NULL; diff --git a/kubernetes/model/v1alpha1_role.c b/kubernetes/model/v1alpha1_role.c index 65c4d41e..0c94e567 100644 --- a/kubernetes/model/v1alpha1_role.c +++ b/kubernetes/model/v1alpha1_role.c @@ -117,6 +117,9 @@ v1alpha1_role_t *v1alpha1_role_parseFromJSON(cJSON *v1alpha1_roleJSON){ // define the local variable for v1alpha1_role->metadata v1_object_meta_t *metadata_local_nonprim = NULL; + // define the local list for v1alpha1_role->rules + list_t *rulesList = NULL; + // v1alpha1_role->api_version cJSON *api_version = cJSON_GetObjectItemCaseSensitive(v1alpha1_roleJSON, "apiVersion"); if (api_version) { @@ -143,9 +146,8 @@ v1alpha1_role_t *v1alpha1_role_parseFromJSON(cJSON *v1alpha1_roleJSON){ // v1alpha1_role->rules cJSON *rules = cJSON_GetObjectItemCaseSensitive(v1alpha1_roleJSON, "rules"); - list_t *rulesList; if (rules) { - cJSON *rules_local_nonprimitive; + cJSON *rules_local_nonprimitive = NULL; if(!cJSON_IsArray(rules)){ goto end; //nonprimitive container } @@ -177,6 +179,15 @@ v1alpha1_role_t *v1alpha1_role_parseFromJSON(cJSON *v1alpha1_roleJSON){ v1_object_meta_free(metadata_local_nonprim); metadata_local_nonprim = NULL; } + if (rulesList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, rulesList) { + v1alpha1_policy_rule_free(listEntry->data); + listEntry->data = NULL; + } + list_freeList(rulesList); + rulesList = NULL; + } return NULL; } diff --git a/kubernetes/model/v1alpha1_role_binding.c b/kubernetes/model/v1alpha1_role_binding.c index 0ee5e458..a862acf1 100644 --- a/kubernetes/model/v1alpha1_role_binding.c +++ b/kubernetes/model/v1alpha1_role_binding.c @@ -141,6 +141,9 @@ v1alpha1_role_binding_t *v1alpha1_role_binding_parseFromJSON(cJSON *v1alpha1_rol // define the local variable for v1alpha1_role_binding->role_ref v1alpha1_role_ref_t *role_ref_local_nonprim = NULL; + // define the local list for v1alpha1_role_binding->subjects + list_t *subjectsList = NULL; + // v1alpha1_role_binding->api_version cJSON *api_version = cJSON_GetObjectItemCaseSensitive(v1alpha1_role_bindingJSON, "apiVersion"); if (api_version) { @@ -176,9 +179,8 @@ v1alpha1_role_binding_t *v1alpha1_role_binding_parseFromJSON(cJSON *v1alpha1_rol // v1alpha1_role_binding->subjects cJSON *subjects = cJSON_GetObjectItemCaseSensitive(v1alpha1_role_bindingJSON, "subjects"); - list_t *subjectsList; if (subjects) { - cJSON *subjects_local_nonprimitive; + cJSON *subjects_local_nonprimitive = NULL; if(!cJSON_IsArray(subjects)){ goto end; //nonprimitive container } @@ -215,6 +217,15 @@ v1alpha1_role_binding_t *v1alpha1_role_binding_parseFromJSON(cJSON *v1alpha1_rol v1alpha1_role_ref_free(role_ref_local_nonprim); role_ref_local_nonprim = NULL; } + if (subjectsList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, subjectsList) { + v1alpha1_subject_free(listEntry->data); + listEntry->data = NULL; + } + list_freeList(subjectsList); + subjectsList = NULL; + } return NULL; } diff --git a/kubernetes/model/v1alpha1_role_binding_list.c b/kubernetes/model/v1alpha1_role_binding_list.c index 45c9c842..6dfbeb26 100644 --- a/kubernetes/model/v1alpha1_role_binding_list.c +++ b/kubernetes/model/v1alpha1_role_binding_list.c @@ -116,6 +116,9 @@ v1alpha1_role_binding_list_t *v1alpha1_role_binding_list_parseFromJSON(cJSON *v1 v1alpha1_role_binding_list_t *v1alpha1_role_binding_list_local_var = NULL; + // define the local list for v1alpha1_role_binding_list->items + list_t *itemsList = NULL; + // define the local variable for v1alpha1_role_binding_list->metadata v1_list_meta_t *metadata_local_nonprim = NULL; @@ -134,9 +137,8 @@ v1alpha1_role_binding_list_t *v1alpha1_role_binding_list_parseFromJSON(cJSON *v1 goto end; } - list_t *itemsList; - cJSON *items_local_nonprimitive; + cJSON *items_local_nonprimitive = NULL; if(!cJSON_IsArray(items)){ goto end; //nonprimitive container } @@ -178,6 +180,15 @@ v1alpha1_role_binding_list_t *v1alpha1_role_binding_list_parseFromJSON(cJSON *v1 return v1alpha1_role_binding_list_local_var; end: + if (itemsList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, itemsList) { + v1alpha1_role_binding_free(listEntry->data); + listEntry->data = NULL; + } + list_freeList(itemsList); + itemsList = NULL; + } if (metadata_local_nonprim) { v1_list_meta_free(metadata_local_nonprim); metadata_local_nonprim = NULL; diff --git a/kubernetes/model/v1alpha1_role_list.c b/kubernetes/model/v1alpha1_role_list.c index 83fb5d99..6a4c32bc 100644 --- a/kubernetes/model/v1alpha1_role_list.c +++ b/kubernetes/model/v1alpha1_role_list.c @@ -116,6 +116,9 @@ v1alpha1_role_list_t *v1alpha1_role_list_parseFromJSON(cJSON *v1alpha1_role_list v1alpha1_role_list_t *v1alpha1_role_list_local_var = NULL; + // define the local list for v1alpha1_role_list->items + list_t *itemsList = NULL; + // define the local variable for v1alpha1_role_list->metadata v1_list_meta_t *metadata_local_nonprim = NULL; @@ -134,9 +137,8 @@ v1alpha1_role_list_t *v1alpha1_role_list_parseFromJSON(cJSON *v1alpha1_role_list goto end; } - list_t *itemsList; - cJSON *items_local_nonprimitive; + cJSON *items_local_nonprimitive = NULL; if(!cJSON_IsArray(items)){ goto end; //nonprimitive container } @@ -178,6 +180,15 @@ v1alpha1_role_list_t *v1alpha1_role_list_parseFromJSON(cJSON *v1alpha1_role_list return v1alpha1_role_list_local_var; end: + if (itemsList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, itemsList) { + v1alpha1_role_free(listEntry->data); + listEntry->data = NULL; + } + list_freeList(itemsList); + itemsList = NULL; + } if (metadata_local_nonprim) { v1_list_meta_free(metadata_local_nonprim); metadata_local_nonprim = NULL; diff --git a/kubernetes/model/v1alpha1_runtime_class_list.c b/kubernetes/model/v1alpha1_runtime_class_list.c index b7eaaea3..04898173 100644 --- a/kubernetes/model/v1alpha1_runtime_class_list.c +++ b/kubernetes/model/v1alpha1_runtime_class_list.c @@ -116,6 +116,9 @@ v1alpha1_runtime_class_list_t *v1alpha1_runtime_class_list_parseFromJSON(cJSON * v1alpha1_runtime_class_list_t *v1alpha1_runtime_class_list_local_var = NULL; + // define the local list for v1alpha1_runtime_class_list->items + list_t *itemsList = NULL; + // define the local variable for v1alpha1_runtime_class_list->metadata v1_list_meta_t *metadata_local_nonprim = NULL; @@ -134,9 +137,8 @@ v1alpha1_runtime_class_list_t *v1alpha1_runtime_class_list_parseFromJSON(cJSON * goto end; } - list_t *itemsList; - cJSON *items_local_nonprimitive; + cJSON *items_local_nonprimitive = NULL; if(!cJSON_IsArray(items)){ goto end; //nonprimitive container } @@ -178,6 +180,15 @@ v1alpha1_runtime_class_list_t *v1alpha1_runtime_class_list_parseFromJSON(cJSON * return v1alpha1_runtime_class_list_local_var; end: + if (itemsList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, itemsList) { + v1alpha1_runtime_class_free(listEntry->data); + listEntry->data = NULL; + } + list_freeList(itemsList); + itemsList = NULL; + } if (metadata_local_nonprim) { v1_list_meta_free(metadata_local_nonprim); metadata_local_nonprim = NULL; diff --git a/kubernetes/model/v1alpha1_scheduling.c b/kubernetes/model/v1alpha1_scheduling.c index ab7df830..f80a006e 100644 --- a/kubernetes/model/v1alpha1_scheduling.c +++ b/kubernetes/model/v1alpha1_scheduling.c @@ -99,11 +99,16 @@ v1alpha1_scheduling_t *v1alpha1_scheduling_parseFromJSON(cJSON *v1alpha1_schedul v1alpha1_scheduling_t *v1alpha1_scheduling_local_var = NULL; + // define the local map for v1alpha1_scheduling->node_selector + list_t *node_selectorList = NULL; + + // define the local list for v1alpha1_scheduling->tolerations + list_t *tolerationsList = NULL; + // v1alpha1_scheduling->node_selector cJSON *node_selector = cJSON_GetObjectItemCaseSensitive(v1alpha1_schedulingJSON, "nodeSelector"); - list_t *node_selectorList; if (node_selector) { - cJSON *node_selector_local_map; + cJSON *node_selector_local_map = NULL; if(!cJSON_IsObject(node_selector)) { goto end;//primitive map container } @@ -123,9 +128,8 @@ v1alpha1_scheduling_t *v1alpha1_scheduling_parseFromJSON(cJSON *v1alpha1_schedul // v1alpha1_scheduling->tolerations cJSON *tolerations = cJSON_GetObjectItemCaseSensitive(v1alpha1_schedulingJSON, "tolerations"); - list_t *tolerationsList; if (tolerations) { - cJSON *tolerations_local_nonprimitive; + cJSON *tolerations_local_nonprimitive = NULL; if(!cJSON_IsArray(tolerations)){ goto end; //nonprimitive container } @@ -151,6 +155,29 @@ v1alpha1_scheduling_t *v1alpha1_scheduling_parseFromJSON(cJSON *v1alpha1_schedul return v1alpha1_scheduling_local_var; end: + if (node_selectorList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, node_selectorList) { + keyValuePair_t *localKeyValue = (keyValuePair_t*) listEntry->data; + free(localKeyValue->key); + localKeyValue->key = NULL; + free(localKeyValue->value); + localKeyValue->value = NULL; + keyValuePair_free(localKeyValue); + localKeyValue = NULL; + } + list_freeList(node_selectorList); + node_selectorList = NULL; + } + if (tolerationsList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, tolerationsList) { + v1_toleration_free(listEntry->data); + listEntry->data = NULL; + } + list_freeList(tolerationsList); + tolerationsList = NULL; + } return NULL; } diff --git a/kubernetes/model/v1alpha1_server_storage_version.c b/kubernetes/model/v1alpha1_server_storage_version.c index 99a7fb1f..f233c4d5 100644 --- a/kubernetes/model/v1alpha1_server_storage_version.c +++ b/kubernetes/model/v1alpha1_server_storage_version.c @@ -92,6 +92,9 @@ v1alpha1_server_storage_version_t *v1alpha1_server_storage_version_parseFromJSON v1alpha1_server_storage_version_t *v1alpha1_server_storage_version_local_var = NULL; + // define the local list for v1alpha1_server_storage_version->decodable_versions + list_t *decodable_versionsList = NULL; + // v1alpha1_server_storage_version->api_server_id cJSON *api_server_id = cJSON_GetObjectItemCaseSensitive(v1alpha1_server_storage_versionJSON, "apiServerID"); if (api_server_id) { @@ -103,9 +106,8 @@ v1alpha1_server_storage_version_t *v1alpha1_server_storage_version_parseFromJSON // v1alpha1_server_storage_version->decodable_versions cJSON *decodable_versions = cJSON_GetObjectItemCaseSensitive(v1alpha1_server_storage_versionJSON, "decodableVersions"); - list_t *decodable_versionsList; if (decodable_versions) { - cJSON *decodable_versions_local; + cJSON *decodable_versions_local = NULL; if(!cJSON_IsArray(decodable_versions)) { goto end;//primitive container } @@ -139,6 +141,15 @@ v1alpha1_server_storage_version_t *v1alpha1_server_storage_version_parseFromJSON return v1alpha1_server_storage_version_local_var; end: + if (decodable_versionsList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, decodable_versionsList) { + free(listEntry->data); + listEntry->data = NULL; + } + list_freeList(decodable_versionsList); + decodable_versionsList = NULL; + } return NULL; } diff --git a/kubernetes/model/v1alpha1_storage_version_list.c b/kubernetes/model/v1alpha1_storage_version_list.c index 3c6b81ba..113230e9 100644 --- a/kubernetes/model/v1alpha1_storage_version_list.c +++ b/kubernetes/model/v1alpha1_storage_version_list.c @@ -116,6 +116,9 @@ v1alpha1_storage_version_list_t *v1alpha1_storage_version_list_parseFromJSON(cJS v1alpha1_storage_version_list_t *v1alpha1_storage_version_list_local_var = NULL; + // define the local list for v1alpha1_storage_version_list->items + list_t *itemsList = NULL; + // define the local variable for v1alpha1_storage_version_list->metadata v1_list_meta_t *metadata_local_nonprim = NULL; @@ -134,9 +137,8 @@ v1alpha1_storage_version_list_t *v1alpha1_storage_version_list_parseFromJSON(cJS goto end; } - list_t *itemsList; - cJSON *items_local_nonprimitive; + cJSON *items_local_nonprimitive = NULL; if(!cJSON_IsArray(items)){ goto end; //nonprimitive container } @@ -178,6 +180,15 @@ v1alpha1_storage_version_list_t *v1alpha1_storage_version_list_parseFromJSON(cJS return v1alpha1_storage_version_list_local_var; end: + if (itemsList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, itemsList) { + v1alpha1_storage_version_free(listEntry->data); + listEntry->data = NULL; + } + list_freeList(itemsList); + itemsList = NULL; + } if (metadata_local_nonprim) { v1_list_meta_free(metadata_local_nonprim); metadata_local_nonprim = NULL; diff --git a/kubernetes/model/v1alpha1_storage_version_status.c b/kubernetes/model/v1alpha1_storage_version_status.c index 170431d4..eedf3461 100644 --- a/kubernetes/model/v1alpha1_storage_version_status.c +++ b/kubernetes/model/v1alpha1_storage_version_status.c @@ -110,6 +110,12 @@ v1alpha1_storage_version_status_t *v1alpha1_storage_version_status_parseFromJSON v1alpha1_storage_version_status_t *v1alpha1_storage_version_status_local_var = NULL; + // define the local list for v1alpha1_storage_version_status->conditions + list_t *conditionsList = NULL; + + // define the local list for v1alpha1_storage_version_status->storage_versions + list_t *storage_versionsList = NULL; + // v1alpha1_storage_version_status->common_encoding_version cJSON *common_encoding_version = cJSON_GetObjectItemCaseSensitive(v1alpha1_storage_version_statusJSON, "commonEncodingVersion"); if (common_encoding_version) { @@ -121,9 +127,8 @@ v1alpha1_storage_version_status_t *v1alpha1_storage_version_status_parseFromJSON // v1alpha1_storage_version_status->conditions cJSON *conditions = cJSON_GetObjectItemCaseSensitive(v1alpha1_storage_version_statusJSON, "conditions"); - list_t *conditionsList; if (conditions) { - cJSON *conditions_local_nonprimitive; + cJSON *conditions_local_nonprimitive = NULL; if(!cJSON_IsArray(conditions)){ goto end; //nonprimitive container } @@ -143,9 +148,8 @@ v1alpha1_storage_version_status_t *v1alpha1_storage_version_status_parseFromJSON // v1alpha1_storage_version_status->storage_versions cJSON *storage_versions = cJSON_GetObjectItemCaseSensitive(v1alpha1_storage_version_statusJSON, "storageVersions"); - list_t *storage_versionsList; if (storage_versions) { - cJSON *storage_versions_local_nonprimitive; + cJSON *storage_versions_local_nonprimitive = NULL; if(!cJSON_IsArray(storage_versions)){ goto end; //nonprimitive container } @@ -172,6 +176,24 @@ v1alpha1_storage_version_status_t *v1alpha1_storage_version_status_parseFromJSON return v1alpha1_storage_version_status_local_var; end: + if (conditionsList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, conditionsList) { + v1alpha1_storage_version_condition_free(listEntry->data); + listEntry->data = NULL; + } + list_freeList(conditionsList); + conditionsList = NULL; + } + if (storage_versionsList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, storage_versionsList) { + v1alpha1_server_storage_version_free(listEntry->data); + listEntry->data = NULL; + } + list_freeList(storage_versionsList); + storage_versionsList = NULL; + } return NULL; } diff --git a/kubernetes/model/v1alpha1_volume_attachment_list.c b/kubernetes/model/v1alpha1_volume_attachment_list.c index f0795342..c63fefdc 100644 --- a/kubernetes/model/v1alpha1_volume_attachment_list.c +++ b/kubernetes/model/v1alpha1_volume_attachment_list.c @@ -116,6 +116,9 @@ v1alpha1_volume_attachment_list_t *v1alpha1_volume_attachment_list_parseFromJSON v1alpha1_volume_attachment_list_t *v1alpha1_volume_attachment_list_local_var = NULL; + // define the local list for v1alpha1_volume_attachment_list->items + list_t *itemsList = NULL; + // define the local variable for v1alpha1_volume_attachment_list->metadata v1_list_meta_t *metadata_local_nonprim = NULL; @@ -134,9 +137,8 @@ v1alpha1_volume_attachment_list_t *v1alpha1_volume_attachment_list_parseFromJSON goto end; } - list_t *itemsList; - cJSON *items_local_nonprimitive; + cJSON *items_local_nonprimitive = NULL; if(!cJSON_IsArray(items)){ goto end; //nonprimitive container } @@ -178,6 +180,15 @@ v1alpha1_volume_attachment_list_t *v1alpha1_volume_attachment_list_parseFromJSON return v1alpha1_volume_attachment_list_local_var; end: + if (itemsList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, itemsList) { + v1alpha1_volume_attachment_free(listEntry->data); + listEntry->data = NULL; + } + list_freeList(itemsList); + itemsList = NULL; + } if (metadata_local_nonprim) { v1_list_meta_free(metadata_local_nonprim); metadata_local_nonprim = NULL; diff --git a/kubernetes/model/v1alpha1_volume_attachment_status.c b/kubernetes/model/v1alpha1_volume_attachment_status.c index 72ba8e7e..8f3ed105 100644 --- a/kubernetes/model/v1alpha1_volume_attachment_status.c +++ b/kubernetes/model/v1alpha1_volume_attachment_status.c @@ -123,6 +123,9 @@ v1alpha1_volume_attachment_status_t *v1alpha1_volume_attachment_status_parseFrom // define the local variable for v1alpha1_volume_attachment_status->attach_error v1alpha1_volume_error_t *attach_error_local_nonprim = NULL; + // define the local map for v1alpha1_volume_attachment_status->attachment_metadata + list_t *attachment_metadataList = NULL; + // define the local variable for v1alpha1_volume_attachment_status->detach_error v1alpha1_volume_error_t *detach_error_local_nonprim = NULL; @@ -146,9 +149,8 @@ v1alpha1_volume_attachment_status_t *v1alpha1_volume_attachment_status_parseFrom // v1alpha1_volume_attachment_status->attachment_metadata cJSON *attachment_metadata = cJSON_GetObjectItemCaseSensitive(v1alpha1_volume_attachment_statusJSON, "attachmentMetadata"); - list_t *attachment_metadataList; if (attachment_metadata) { - cJSON *attachment_metadata_local_map; + cJSON *attachment_metadata_local_map = NULL; if(!cJSON_IsObject(attachment_metadata)) { goto end;//primitive map container } @@ -186,6 +188,20 @@ v1alpha1_volume_attachment_status_t *v1alpha1_volume_attachment_status_parseFrom v1alpha1_volume_error_free(attach_error_local_nonprim); attach_error_local_nonprim = NULL; } + if (attachment_metadataList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, attachment_metadataList) { + keyValuePair_t *localKeyValue = (keyValuePair_t*) listEntry->data; + free(localKeyValue->key); + localKeyValue->key = NULL; + free(localKeyValue->value); + localKeyValue->value = NULL; + keyValuePair_free(localKeyValue); + localKeyValue = NULL; + } + list_freeList(attachment_metadataList); + attachment_metadataList = NULL; + } if (detach_error_local_nonprim) { v1alpha1_volume_error_free(detach_error_local_nonprim); detach_error_local_nonprim = NULL; diff --git a/kubernetes/model/v1beta1_cron_job_list.c b/kubernetes/model/v1beta1_cron_job_list.c index 2c5152b4..37359a8d 100644 --- a/kubernetes/model/v1beta1_cron_job_list.c +++ b/kubernetes/model/v1beta1_cron_job_list.c @@ -116,6 +116,9 @@ v1beta1_cron_job_list_t *v1beta1_cron_job_list_parseFromJSON(cJSON *v1beta1_cron v1beta1_cron_job_list_t *v1beta1_cron_job_list_local_var = NULL; + // define the local list for v1beta1_cron_job_list->items + list_t *itemsList = NULL; + // define the local variable for v1beta1_cron_job_list->metadata v1_list_meta_t *metadata_local_nonprim = NULL; @@ -134,9 +137,8 @@ v1beta1_cron_job_list_t *v1beta1_cron_job_list_parseFromJSON(cJSON *v1beta1_cron goto end; } - list_t *itemsList; - cJSON *items_local_nonprimitive; + cJSON *items_local_nonprimitive = NULL; if(!cJSON_IsArray(items)){ goto end; //nonprimitive container } @@ -178,6 +180,15 @@ v1beta1_cron_job_list_t *v1beta1_cron_job_list_parseFromJSON(cJSON *v1beta1_cron return v1beta1_cron_job_list_local_var; end: + if (itemsList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, itemsList) { + v1beta1_cron_job_free(listEntry->data); + listEntry->data = NULL; + } + list_freeList(itemsList); + itemsList = NULL; + } if (metadata_local_nonprim) { v1_list_meta_free(metadata_local_nonprim); metadata_local_nonprim = NULL; diff --git a/kubernetes/model/v1beta1_cron_job_status.c b/kubernetes/model/v1beta1_cron_job_status.c index 86af582d..1d03c9cd 100644 --- a/kubernetes/model/v1beta1_cron_job_status.c +++ b/kubernetes/model/v1beta1_cron_job_status.c @@ -95,11 +95,13 @@ v1beta1_cron_job_status_t *v1beta1_cron_job_status_parseFromJSON(cJSON *v1beta1_ v1beta1_cron_job_status_t *v1beta1_cron_job_status_local_var = NULL; + // define the local list for v1beta1_cron_job_status->active + list_t *activeList = NULL; + // v1beta1_cron_job_status->active cJSON *active = cJSON_GetObjectItemCaseSensitive(v1beta1_cron_job_statusJSON, "active"); - list_t *activeList; if (active) { - cJSON *active_local_nonprimitive; + cJSON *active_local_nonprimitive = NULL; if(!cJSON_IsArray(active)){ goto end; //nonprimitive container } @@ -144,6 +146,15 @@ v1beta1_cron_job_status_t *v1beta1_cron_job_status_parseFromJSON(cJSON *v1beta1_ return v1beta1_cron_job_status_local_var; end: + if (activeList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, activeList) { + v1_object_reference_free(listEntry->data); + listEntry->data = NULL; + } + list_freeList(activeList); + activeList = NULL; + } return NULL; } diff --git a/kubernetes/model/v1beta1_csi_storage_capacity_list.c b/kubernetes/model/v1beta1_csi_storage_capacity_list.c index 48168ea0..cf09e522 100644 --- a/kubernetes/model/v1beta1_csi_storage_capacity_list.c +++ b/kubernetes/model/v1beta1_csi_storage_capacity_list.c @@ -116,6 +116,9 @@ v1beta1_csi_storage_capacity_list_t *v1beta1_csi_storage_capacity_list_parseFrom v1beta1_csi_storage_capacity_list_t *v1beta1_csi_storage_capacity_list_local_var = NULL; + // define the local list for v1beta1_csi_storage_capacity_list->items + list_t *itemsList = NULL; + // define the local variable for v1beta1_csi_storage_capacity_list->metadata v1_list_meta_t *metadata_local_nonprim = NULL; @@ -134,9 +137,8 @@ v1beta1_csi_storage_capacity_list_t *v1beta1_csi_storage_capacity_list_parseFrom goto end; } - list_t *itemsList; - cJSON *items_local_nonprimitive; + cJSON *items_local_nonprimitive = NULL; if(!cJSON_IsArray(items)){ goto end; //nonprimitive container } @@ -178,6 +180,15 @@ v1beta1_csi_storage_capacity_list_t *v1beta1_csi_storage_capacity_list_parseFrom return v1beta1_csi_storage_capacity_list_local_var; end: + if (itemsList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, itemsList) { + v1beta1_csi_storage_capacity_free(listEntry->data); + listEntry->data = NULL; + } + list_freeList(itemsList); + itemsList = NULL; + } if (metadata_local_nonprim) { v1_list_meta_free(metadata_local_nonprim); metadata_local_nonprim = NULL; diff --git a/kubernetes/model/v1beta1_endpoint.c b/kubernetes/model/v1beta1_endpoint.c index df762ec5..855fa217 100644 --- a/kubernetes/model/v1beta1_endpoint.c +++ b/kubernetes/model/v1beta1_endpoint.c @@ -183,6 +183,9 @@ v1beta1_endpoint_t *v1beta1_endpoint_parseFromJSON(cJSON *v1beta1_endpointJSON){ v1beta1_endpoint_t *v1beta1_endpoint_local_var = NULL; + // define the local list for v1beta1_endpoint->addresses + list_t *addressesList = NULL; + // define the local variable for v1beta1_endpoint->conditions v1beta1_endpoint_conditions_t *conditions_local_nonprim = NULL; @@ -192,15 +195,17 @@ v1beta1_endpoint_t *v1beta1_endpoint_parseFromJSON(cJSON *v1beta1_endpointJSON){ // define the local variable for v1beta1_endpoint->target_ref v1_object_reference_t *target_ref_local_nonprim = NULL; + // define the local map for v1beta1_endpoint->topology + list_t *topologyList = NULL; + // v1beta1_endpoint->addresses cJSON *addresses = cJSON_GetObjectItemCaseSensitive(v1beta1_endpointJSON, "addresses"); if (!addresses) { goto end; } - list_t *addressesList; - cJSON *addresses_local; + cJSON *addresses_local = NULL; if(!cJSON_IsArray(addresses)) { goto end;//primitive container } @@ -253,9 +258,8 @@ v1beta1_endpoint_t *v1beta1_endpoint_parseFromJSON(cJSON *v1beta1_endpointJSON){ // v1beta1_endpoint->topology cJSON *topology = cJSON_GetObjectItemCaseSensitive(v1beta1_endpointJSON, "topology"); - list_t *topologyList; if (topology) { - cJSON *topology_local_map; + cJSON *topology_local_map = NULL; if(!cJSON_IsObject(topology)) { goto end;//primitive map container } @@ -286,6 +290,15 @@ v1beta1_endpoint_t *v1beta1_endpoint_parseFromJSON(cJSON *v1beta1_endpointJSON){ return v1beta1_endpoint_local_var; end: + if (addressesList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, addressesList) { + free(listEntry->data); + listEntry->data = NULL; + } + list_freeList(addressesList); + addressesList = NULL; + } if (conditions_local_nonprim) { v1beta1_endpoint_conditions_free(conditions_local_nonprim); conditions_local_nonprim = NULL; @@ -298,6 +311,20 @@ v1beta1_endpoint_t *v1beta1_endpoint_parseFromJSON(cJSON *v1beta1_endpointJSON){ v1_object_reference_free(target_ref_local_nonprim); target_ref_local_nonprim = NULL; } + if (topologyList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, topologyList) { + keyValuePair_t *localKeyValue = (keyValuePair_t*) listEntry->data; + free(localKeyValue->key); + localKeyValue->key = NULL; + free(localKeyValue->value); + localKeyValue->value = NULL; + keyValuePair_free(localKeyValue); + localKeyValue = NULL; + } + list_freeList(topologyList); + topologyList = NULL; + } return NULL; } diff --git a/kubernetes/model/v1beta1_endpoint_hints.c b/kubernetes/model/v1beta1_endpoint_hints.c index 6097e40c..461010e8 100644 --- a/kubernetes/model/v1beta1_endpoint_hints.c +++ b/kubernetes/model/v1beta1_endpoint_hints.c @@ -67,11 +67,13 @@ v1beta1_endpoint_hints_t *v1beta1_endpoint_hints_parseFromJSON(cJSON *v1beta1_en v1beta1_endpoint_hints_t *v1beta1_endpoint_hints_local_var = NULL; + // define the local list for v1beta1_endpoint_hints->for_zones + list_t *for_zonesList = NULL; + // v1beta1_endpoint_hints->for_zones cJSON *for_zones = cJSON_GetObjectItemCaseSensitive(v1beta1_endpoint_hintsJSON, "forZones"); - list_t *for_zonesList; if (for_zones) { - cJSON *for_zones_local_nonprimitive; + cJSON *for_zones_local_nonprimitive = NULL; if(!cJSON_IsArray(for_zones)){ goto end; //nonprimitive container } @@ -96,6 +98,15 @@ v1beta1_endpoint_hints_t *v1beta1_endpoint_hints_parseFromJSON(cJSON *v1beta1_en return v1beta1_endpoint_hints_local_var; end: + if (for_zonesList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, for_zonesList) { + v1beta1_for_zone_free(listEntry->data); + listEntry->data = NULL; + } + list_freeList(for_zonesList); + for_zonesList = NULL; + } return NULL; } diff --git a/kubernetes/model/v1beta1_endpoint_slice.c b/kubernetes/model/v1beta1_endpoint_slice.c index 83795a07..83e527cb 100644 --- a/kubernetes/model/v1beta1_endpoint_slice.c +++ b/kubernetes/model/v1beta1_endpoint_slice.c @@ -161,9 +161,15 @@ v1beta1_endpoint_slice_t *v1beta1_endpoint_slice_parseFromJSON(cJSON *v1beta1_en v1beta1_endpoint_slice_t *v1beta1_endpoint_slice_local_var = NULL; + // define the local list for v1beta1_endpoint_slice->endpoints + list_t *endpointsList = NULL; + // define the local variable for v1beta1_endpoint_slice->metadata v1_object_meta_t *metadata_local_nonprim = NULL; + // define the local list for v1beta1_endpoint_slice->ports + list_t *portsList = NULL; + // v1beta1_endpoint_slice->address_type cJSON *address_type = cJSON_GetObjectItemCaseSensitive(v1beta1_endpoint_sliceJSON, "addressType"); if (!address_type) { @@ -191,9 +197,8 @@ v1beta1_endpoint_slice_t *v1beta1_endpoint_slice_parseFromJSON(cJSON *v1beta1_en goto end; } - list_t *endpointsList; - cJSON *endpoints_local_nonprimitive; + cJSON *endpoints_local_nonprimitive = NULL; if(!cJSON_IsArray(endpoints)){ goto end; //nonprimitive container } @@ -227,9 +232,8 @@ v1beta1_endpoint_slice_t *v1beta1_endpoint_slice_parseFromJSON(cJSON *v1beta1_en // v1beta1_endpoint_slice->ports cJSON *ports = cJSON_GetObjectItemCaseSensitive(v1beta1_endpoint_sliceJSON, "ports"); - list_t *portsList; if (ports) { - cJSON *ports_local_nonprimitive; + cJSON *ports_local_nonprimitive = NULL; if(!cJSON_IsArray(ports)){ goto end; //nonprimitive container } @@ -259,10 +263,28 @@ v1beta1_endpoint_slice_t *v1beta1_endpoint_slice_parseFromJSON(cJSON *v1beta1_en return v1beta1_endpoint_slice_local_var; end: + if (endpointsList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, endpointsList) { + v1beta1_endpoint_free(listEntry->data); + listEntry->data = NULL; + } + list_freeList(endpointsList); + endpointsList = NULL; + } if (metadata_local_nonprim) { v1_object_meta_free(metadata_local_nonprim); metadata_local_nonprim = NULL; } + if (portsList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, portsList) { + v1beta1_endpoint_port_free(listEntry->data); + listEntry->data = NULL; + } + list_freeList(portsList); + portsList = NULL; + } return NULL; } diff --git a/kubernetes/model/v1beta1_endpoint_slice_list.c b/kubernetes/model/v1beta1_endpoint_slice_list.c index 2c1f9dd2..39eaf983 100644 --- a/kubernetes/model/v1beta1_endpoint_slice_list.c +++ b/kubernetes/model/v1beta1_endpoint_slice_list.c @@ -116,6 +116,9 @@ v1beta1_endpoint_slice_list_t *v1beta1_endpoint_slice_list_parseFromJSON(cJSON * v1beta1_endpoint_slice_list_t *v1beta1_endpoint_slice_list_local_var = NULL; + // define the local list for v1beta1_endpoint_slice_list->items + list_t *itemsList = NULL; + // define the local variable for v1beta1_endpoint_slice_list->metadata v1_list_meta_t *metadata_local_nonprim = NULL; @@ -134,9 +137,8 @@ v1beta1_endpoint_slice_list_t *v1beta1_endpoint_slice_list_parseFromJSON(cJSON * goto end; } - list_t *itemsList; - cJSON *items_local_nonprimitive; + cJSON *items_local_nonprimitive = NULL; if(!cJSON_IsArray(items)){ goto end; //nonprimitive container } @@ -178,6 +180,15 @@ v1beta1_endpoint_slice_list_t *v1beta1_endpoint_slice_list_parseFromJSON(cJSON * return v1beta1_endpoint_slice_list_local_var; end: + if (itemsList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, itemsList) { + v1beta1_endpoint_slice_free(listEntry->data); + listEntry->data = NULL; + } + list_freeList(itemsList); + itemsList = NULL; + } if (metadata_local_nonprim) { v1_list_meta_free(metadata_local_nonprim); metadata_local_nonprim = NULL; diff --git a/kubernetes/model/v1beta1_event_list.c b/kubernetes/model/v1beta1_event_list.c index 8ca6b171..ff9430ad 100644 --- a/kubernetes/model/v1beta1_event_list.c +++ b/kubernetes/model/v1beta1_event_list.c @@ -116,6 +116,9 @@ v1beta1_event_list_t *v1beta1_event_list_parseFromJSON(cJSON *v1beta1_event_list v1beta1_event_list_t *v1beta1_event_list_local_var = NULL; + // define the local list for v1beta1_event_list->items + list_t *itemsList = NULL; + // define the local variable for v1beta1_event_list->metadata v1_list_meta_t *metadata_local_nonprim = NULL; @@ -134,9 +137,8 @@ v1beta1_event_list_t *v1beta1_event_list_parseFromJSON(cJSON *v1beta1_event_list goto end; } - list_t *itemsList; - cJSON *items_local_nonprimitive; + cJSON *items_local_nonprimitive = NULL; if(!cJSON_IsArray(items)){ goto end; //nonprimitive container } @@ -178,6 +180,15 @@ v1beta1_event_list_t *v1beta1_event_list_parseFromJSON(cJSON *v1beta1_event_list return v1beta1_event_list_local_var; end: + if (itemsList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, itemsList) { + v1beta1_event_free(listEntry->data); + listEntry->data = NULL; + } + list_freeList(itemsList); + itemsList = NULL; + } if (metadata_local_nonprim) { v1_list_meta_free(metadata_local_nonprim); metadata_local_nonprim = NULL; diff --git a/kubernetes/model/v1beta1_flow_schema_list.c b/kubernetes/model/v1beta1_flow_schema_list.c index abfc3719..57b0d859 100644 --- a/kubernetes/model/v1beta1_flow_schema_list.c +++ b/kubernetes/model/v1beta1_flow_schema_list.c @@ -116,6 +116,9 @@ v1beta1_flow_schema_list_t *v1beta1_flow_schema_list_parseFromJSON(cJSON *v1beta v1beta1_flow_schema_list_t *v1beta1_flow_schema_list_local_var = NULL; + // define the local list for v1beta1_flow_schema_list->items + list_t *itemsList = NULL; + // define the local variable for v1beta1_flow_schema_list->metadata v1_list_meta_t *metadata_local_nonprim = NULL; @@ -134,9 +137,8 @@ v1beta1_flow_schema_list_t *v1beta1_flow_schema_list_parseFromJSON(cJSON *v1beta goto end; } - list_t *itemsList; - cJSON *items_local_nonprimitive; + cJSON *items_local_nonprimitive = NULL; if(!cJSON_IsArray(items)){ goto end; //nonprimitive container } @@ -178,6 +180,15 @@ v1beta1_flow_schema_list_t *v1beta1_flow_schema_list_parseFromJSON(cJSON *v1beta return v1beta1_flow_schema_list_local_var; end: + if (itemsList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, itemsList) { + v1beta1_flow_schema_free(listEntry->data); + listEntry->data = NULL; + } + list_freeList(itemsList); + itemsList = NULL; + } if (metadata_local_nonprim) { v1_list_meta_free(metadata_local_nonprim); metadata_local_nonprim = NULL; diff --git a/kubernetes/model/v1beta1_flow_schema_spec.c b/kubernetes/model/v1beta1_flow_schema_spec.c index 0d218fd5..ae147d02 100644 --- a/kubernetes/model/v1beta1_flow_schema_spec.c +++ b/kubernetes/model/v1beta1_flow_schema_spec.c @@ -123,6 +123,9 @@ v1beta1_flow_schema_spec_t *v1beta1_flow_schema_spec_parseFromJSON(cJSON *v1beta // define the local variable for v1beta1_flow_schema_spec->priority_level_configuration v1beta1_priority_level_configuration_reference_t *priority_level_configuration_local_nonprim = NULL; + // define the local list for v1beta1_flow_schema_spec->rules + list_t *rulesList = NULL; + // v1beta1_flow_schema_spec->distinguisher_method cJSON *distinguisher_method = cJSON_GetObjectItemCaseSensitive(v1beta1_flow_schema_specJSON, "distinguisherMethod"); if (distinguisher_method) { @@ -149,9 +152,8 @@ v1beta1_flow_schema_spec_t *v1beta1_flow_schema_spec_parseFromJSON(cJSON *v1beta // v1beta1_flow_schema_spec->rules cJSON *rules = cJSON_GetObjectItemCaseSensitive(v1beta1_flow_schema_specJSON, "rules"); - list_t *rulesList; if (rules) { - cJSON *rules_local_nonprimitive; + cJSON *rules_local_nonprimitive = NULL; if(!cJSON_IsArray(rules)){ goto end; //nonprimitive container } @@ -187,6 +189,15 @@ v1beta1_flow_schema_spec_t *v1beta1_flow_schema_spec_parseFromJSON(cJSON *v1beta v1beta1_priority_level_configuration_reference_free(priority_level_configuration_local_nonprim); priority_level_configuration_local_nonprim = NULL; } + if (rulesList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, rulesList) { + v1beta1_policy_rules_with_subjects_free(listEntry->data); + listEntry->data = NULL; + } + list_freeList(rulesList); + rulesList = NULL; + } return NULL; } diff --git a/kubernetes/model/v1beta1_flow_schema_status.c b/kubernetes/model/v1beta1_flow_schema_status.c index 7efbf8e9..9b23dd86 100644 --- a/kubernetes/model/v1beta1_flow_schema_status.c +++ b/kubernetes/model/v1beta1_flow_schema_status.c @@ -67,11 +67,13 @@ v1beta1_flow_schema_status_t *v1beta1_flow_schema_status_parseFromJSON(cJSON *v1 v1beta1_flow_schema_status_t *v1beta1_flow_schema_status_local_var = NULL; + // define the local list for v1beta1_flow_schema_status->conditions + list_t *conditionsList = NULL; + // v1beta1_flow_schema_status->conditions cJSON *conditions = cJSON_GetObjectItemCaseSensitive(v1beta1_flow_schema_statusJSON, "conditions"); - list_t *conditionsList; if (conditions) { - cJSON *conditions_local_nonprimitive; + cJSON *conditions_local_nonprimitive = NULL; if(!cJSON_IsArray(conditions)){ goto end; //nonprimitive container } @@ -96,6 +98,15 @@ v1beta1_flow_schema_status_t *v1beta1_flow_schema_status_parseFromJSON(cJSON *v1 return v1beta1_flow_schema_status_local_var; end: + if (conditionsList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, conditionsList) { + v1beta1_flow_schema_condition_free(listEntry->data); + listEntry->data = NULL; + } + list_freeList(conditionsList); + conditionsList = NULL; + } return NULL; } diff --git a/kubernetes/model/v1beta1_fs_group_strategy_options.c b/kubernetes/model/v1beta1_fs_group_strategy_options.c index 09bcb0d4..d5474e83 100644 --- a/kubernetes/model/v1beta1_fs_group_strategy_options.c +++ b/kubernetes/model/v1beta1_fs_group_strategy_options.c @@ -81,11 +81,13 @@ v1beta1_fs_group_strategy_options_t *v1beta1_fs_group_strategy_options_parseFrom v1beta1_fs_group_strategy_options_t *v1beta1_fs_group_strategy_options_local_var = NULL; + // define the local list for v1beta1_fs_group_strategy_options->ranges + list_t *rangesList = NULL; + // v1beta1_fs_group_strategy_options->ranges cJSON *ranges = cJSON_GetObjectItemCaseSensitive(v1beta1_fs_group_strategy_optionsJSON, "ranges"); - list_t *rangesList; if (ranges) { - cJSON *ranges_local_nonprimitive; + cJSON *ranges_local_nonprimitive = NULL; if(!cJSON_IsArray(ranges)){ goto end; //nonprimitive container } @@ -120,6 +122,15 @@ v1beta1_fs_group_strategy_options_t *v1beta1_fs_group_strategy_options_parseFrom return v1beta1_fs_group_strategy_options_local_var; end: + if (rangesList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, rangesList) { + v1beta1_id_range_free(listEntry->data); + listEntry->data = NULL; + } + list_freeList(rangesList); + rangesList = NULL; + } return NULL; } diff --git a/kubernetes/model/v1beta1_non_resource_policy_rule.c b/kubernetes/model/v1beta1_non_resource_policy_rule.c index 1ac8903d..a4d442b9 100644 --- a/kubernetes/model/v1beta1_non_resource_policy_rule.c +++ b/kubernetes/model/v1beta1_non_resource_policy_rule.c @@ -94,15 +94,20 @@ v1beta1_non_resource_policy_rule_t *v1beta1_non_resource_policy_rule_parseFromJS v1beta1_non_resource_policy_rule_t *v1beta1_non_resource_policy_rule_local_var = NULL; + // define the local list for v1beta1_non_resource_policy_rule->non_resource_urls + list_t *non_resource_urlsList = NULL; + + // define the local list for v1beta1_non_resource_policy_rule->verbs + list_t *verbsList = NULL; + // v1beta1_non_resource_policy_rule->non_resource_urls cJSON *non_resource_urls = cJSON_GetObjectItemCaseSensitive(v1beta1_non_resource_policy_ruleJSON, "nonResourceURLs"); if (!non_resource_urls) { goto end; } - list_t *non_resource_urlsList; - cJSON *non_resource_urls_local; + cJSON *non_resource_urls_local = NULL; if(!cJSON_IsArray(non_resource_urls)) { goto end;//primitive container } @@ -123,9 +128,8 @@ v1beta1_non_resource_policy_rule_t *v1beta1_non_resource_policy_rule_parseFromJS goto end; } - list_t *verbsList; - cJSON *verbs_local; + cJSON *verbs_local = NULL; if(!cJSON_IsArray(verbs)) { goto end;//primitive container } @@ -148,6 +152,24 @@ v1beta1_non_resource_policy_rule_t *v1beta1_non_resource_policy_rule_parseFromJS return v1beta1_non_resource_policy_rule_local_var; end: + if (non_resource_urlsList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, non_resource_urlsList) { + free(listEntry->data); + listEntry->data = NULL; + } + list_freeList(non_resource_urlsList); + non_resource_urlsList = NULL; + } + if (verbsList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, verbsList) { + free(listEntry->data); + listEntry->data = NULL; + } + list_freeList(verbsList); + verbsList = NULL; + } return NULL; } diff --git a/kubernetes/model/v1beta1_overhead.c b/kubernetes/model/v1beta1_overhead.c index a3d80c77..706db029 100644 --- a/kubernetes/model/v1beta1_overhead.c +++ b/kubernetes/model/v1beta1_overhead.c @@ -70,11 +70,13 @@ v1beta1_overhead_t *v1beta1_overhead_parseFromJSON(cJSON *v1beta1_overheadJSON){ v1beta1_overhead_t *v1beta1_overhead_local_var = NULL; + // define the local map for v1beta1_overhead->pod_fixed + list_t *pod_fixedList = NULL; + // v1beta1_overhead->pod_fixed cJSON *pod_fixed = cJSON_GetObjectItemCaseSensitive(v1beta1_overheadJSON, "podFixed"); - list_t *pod_fixedList; if (pod_fixed) { - cJSON *pod_fixed_local_map; + cJSON *pod_fixed_local_map = NULL; if(!cJSON_IsObject(pod_fixed)) { goto end;//primitive map container } @@ -99,6 +101,20 @@ v1beta1_overhead_t *v1beta1_overhead_parseFromJSON(cJSON *v1beta1_overheadJSON){ return v1beta1_overhead_local_var; end: + if (pod_fixedList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, pod_fixedList) { + keyValuePair_t *localKeyValue = (keyValuePair_t*) listEntry->data; + free(localKeyValue->key); + localKeyValue->key = NULL; + free(localKeyValue->value); + localKeyValue->value = NULL; + keyValuePair_free(localKeyValue); + localKeyValue = NULL; + } + list_freeList(pod_fixedList); + pod_fixedList = NULL; + } return NULL; } diff --git a/kubernetes/model/v1beta1_pod_disruption_budget_list.c b/kubernetes/model/v1beta1_pod_disruption_budget_list.c index 42f79819..a36806fc 100644 --- a/kubernetes/model/v1beta1_pod_disruption_budget_list.c +++ b/kubernetes/model/v1beta1_pod_disruption_budget_list.c @@ -116,6 +116,9 @@ v1beta1_pod_disruption_budget_list_t *v1beta1_pod_disruption_budget_list_parseFr v1beta1_pod_disruption_budget_list_t *v1beta1_pod_disruption_budget_list_local_var = NULL; + // define the local list for v1beta1_pod_disruption_budget_list->items + list_t *itemsList = NULL; + // define the local variable for v1beta1_pod_disruption_budget_list->metadata v1_list_meta_t *metadata_local_nonprim = NULL; @@ -134,9 +137,8 @@ v1beta1_pod_disruption_budget_list_t *v1beta1_pod_disruption_budget_list_parseFr goto end; } - list_t *itemsList; - cJSON *items_local_nonprimitive; + cJSON *items_local_nonprimitive = NULL; if(!cJSON_IsArray(items)){ goto end; //nonprimitive container } @@ -178,6 +180,15 @@ v1beta1_pod_disruption_budget_list_t *v1beta1_pod_disruption_budget_list_parseFr return v1beta1_pod_disruption_budget_list_local_var; end: + if (itemsList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, itemsList) { + v1beta1_pod_disruption_budget_free(listEntry->data); + listEntry->data = NULL; + } + list_freeList(itemsList); + itemsList = NULL; + } if (metadata_local_nonprim) { v1_list_meta_free(metadata_local_nonprim); metadata_local_nonprim = NULL; diff --git a/kubernetes/model/v1beta1_pod_disruption_budget_status.c b/kubernetes/model/v1beta1_pod_disruption_budget_status.c index 8cc1080f..549a0c39 100644 --- a/kubernetes/model/v1beta1_pod_disruption_budget_status.c +++ b/kubernetes/model/v1beta1_pod_disruption_budget_status.c @@ -153,11 +153,16 @@ v1beta1_pod_disruption_budget_status_t *v1beta1_pod_disruption_budget_status_par v1beta1_pod_disruption_budget_status_t *v1beta1_pod_disruption_budget_status_local_var = NULL; + // define the local list for v1beta1_pod_disruption_budget_status->conditions + list_t *conditionsList = NULL; + + // define the local map for v1beta1_pod_disruption_budget_status->disrupted_pods + list_t *disrupted_podsList = NULL; + // v1beta1_pod_disruption_budget_status->conditions cJSON *conditions = cJSON_GetObjectItemCaseSensitive(v1beta1_pod_disruption_budget_statusJSON, "conditions"); - list_t *conditionsList; if (conditions) { - cJSON *conditions_local_nonprimitive; + cJSON *conditions_local_nonprimitive = NULL; if(!cJSON_IsArray(conditions)){ goto end; //nonprimitive container } @@ -201,9 +206,8 @@ v1beta1_pod_disruption_budget_status_t *v1beta1_pod_disruption_budget_status_par // v1beta1_pod_disruption_budget_status->disrupted_pods cJSON *disrupted_pods = cJSON_GetObjectItemCaseSensitive(v1beta1_pod_disruption_budget_statusJSON, "disruptedPods"); - list_t *disrupted_podsList; if (disrupted_pods) { - cJSON *disrupted_pods_local_map; + cJSON *disrupted_pods_local_map = NULL; if(!cJSON_IsObject(disrupted_pods)) { goto end;//primitive map container } @@ -262,6 +266,27 @@ v1beta1_pod_disruption_budget_status_t *v1beta1_pod_disruption_budget_status_par return v1beta1_pod_disruption_budget_status_local_var; end: + if (conditionsList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, conditionsList) { + v1_condition_free(listEntry->data); + listEntry->data = NULL; + } + list_freeList(conditionsList); + conditionsList = NULL; + } + if (disrupted_podsList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, disrupted_podsList) { + keyValuePair_t *localKeyValue = (keyValuePair_t*) listEntry->data; + free(localKeyValue->key); + localKeyValue->key = NULL; + keyValuePair_free(localKeyValue); + localKeyValue = NULL; + } + list_freeList(disrupted_podsList); + disrupted_podsList = NULL; + } return NULL; } diff --git a/kubernetes/model/v1beta1_pod_security_policy_list.c b/kubernetes/model/v1beta1_pod_security_policy_list.c index 5d327ccf..8582b526 100644 --- a/kubernetes/model/v1beta1_pod_security_policy_list.c +++ b/kubernetes/model/v1beta1_pod_security_policy_list.c @@ -116,6 +116,9 @@ v1beta1_pod_security_policy_list_t *v1beta1_pod_security_policy_list_parseFromJS v1beta1_pod_security_policy_list_t *v1beta1_pod_security_policy_list_local_var = NULL; + // define the local list for v1beta1_pod_security_policy_list->items + list_t *itemsList = NULL; + // define the local variable for v1beta1_pod_security_policy_list->metadata v1_list_meta_t *metadata_local_nonprim = NULL; @@ -134,9 +137,8 @@ v1beta1_pod_security_policy_list_t *v1beta1_pod_security_policy_list_parseFromJS goto end; } - list_t *itemsList; - cJSON *items_local_nonprimitive; + cJSON *items_local_nonprimitive = NULL; if(!cJSON_IsArray(items)){ goto end; //nonprimitive container } @@ -178,6 +180,15 @@ v1beta1_pod_security_policy_list_t *v1beta1_pod_security_policy_list_parseFromJS return v1beta1_pod_security_policy_list_local_var; end: + if (itemsList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, itemsList) { + v1beta1_pod_security_policy_free(listEntry->data); + listEntry->data = NULL; + } + list_freeList(itemsList); + itemsList = NULL; + } if (metadata_local_nonprim) { v1_list_meta_free(metadata_local_nonprim); metadata_local_nonprim = NULL; diff --git a/kubernetes/model/v1beta1_pod_security_policy_spec.c b/kubernetes/model/v1beta1_pod_security_policy_spec.c index 89b3d839..69138c5b 100644 --- a/kubernetes/model/v1beta1_pod_security_policy_spec.c +++ b/kubernetes/model/v1beta1_pod_security_policy_spec.c @@ -528,9 +528,39 @@ v1beta1_pod_security_policy_spec_t *v1beta1_pod_security_policy_spec_parseFromJS v1beta1_pod_security_policy_spec_t *v1beta1_pod_security_policy_spec_local_var = NULL; + // define the local list for v1beta1_pod_security_policy_spec->allowed_csi_drivers + list_t *allowed_csi_driversList = NULL; + + // define the local list for v1beta1_pod_security_policy_spec->allowed_capabilities + list_t *allowed_capabilitiesList = NULL; + + // define the local list for v1beta1_pod_security_policy_spec->allowed_flex_volumes + list_t *allowed_flex_volumesList = NULL; + + // define the local list for v1beta1_pod_security_policy_spec->allowed_host_paths + list_t *allowed_host_pathsList = NULL; + + // define the local list for v1beta1_pod_security_policy_spec->allowed_proc_mount_types + list_t *allowed_proc_mount_typesList = NULL; + + // define the local list for v1beta1_pod_security_policy_spec->allowed_unsafe_sysctls + list_t *allowed_unsafe_sysctlsList = NULL; + + // define the local list for v1beta1_pod_security_policy_spec->default_add_capabilities + list_t *default_add_capabilitiesList = NULL; + + // define the local list for v1beta1_pod_security_policy_spec->forbidden_sysctls + list_t *forbidden_sysctlsList = NULL; + // define the local variable for v1beta1_pod_security_policy_spec->fs_group v1beta1_fs_group_strategy_options_t *fs_group_local_nonprim = NULL; + // define the local list for v1beta1_pod_security_policy_spec->host_ports + list_t *host_portsList = NULL; + + // define the local list for v1beta1_pod_security_policy_spec->required_drop_capabilities + list_t *required_drop_capabilitiesList = NULL; + // define the local variable for v1beta1_pod_security_policy_spec->run_as_group v1beta1_run_as_group_strategy_options_t *run_as_group_local_nonprim = NULL; @@ -546,6 +576,9 @@ v1beta1_pod_security_policy_spec_t *v1beta1_pod_security_policy_spec_parseFromJS // define the local variable for v1beta1_pod_security_policy_spec->supplemental_groups v1beta1_supplemental_groups_strategy_options_t *supplemental_groups_local_nonprim = NULL; + // define the local list for v1beta1_pod_security_policy_spec->volumes + list_t *volumesList = NULL; + // v1beta1_pod_security_policy_spec->allow_privilege_escalation cJSON *allow_privilege_escalation = cJSON_GetObjectItemCaseSensitive(v1beta1_pod_security_policy_specJSON, "allowPrivilegeEscalation"); if (allow_privilege_escalation) { @@ -557,9 +590,8 @@ v1beta1_pod_security_policy_spec_t *v1beta1_pod_security_policy_spec_parseFromJS // v1beta1_pod_security_policy_spec->allowed_csi_drivers cJSON *allowed_csi_drivers = cJSON_GetObjectItemCaseSensitive(v1beta1_pod_security_policy_specJSON, "allowedCSIDrivers"); - list_t *allowed_csi_driversList; if (allowed_csi_drivers) { - cJSON *allowed_csi_drivers_local_nonprimitive; + cJSON *allowed_csi_drivers_local_nonprimitive = NULL; if(!cJSON_IsArray(allowed_csi_drivers)){ goto end; //nonprimitive container } @@ -579,9 +611,8 @@ v1beta1_pod_security_policy_spec_t *v1beta1_pod_security_policy_spec_parseFromJS // v1beta1_pod_security_policy_spec->allowed_capabilities cJSON *allowed_capabilities = cJSON_GetObjectItemCaseSensitive(v1beta1_pod_security_policy_specJSON, "allowedCapabilities"); - list_t *allowed_capabilitiesList; if (allowed_capabilities) { - cJSON *allowed_capabilities_local; + cJSON *allowed_capabilities_local = NULL; if(!cJSON_IsArray(allowed_capabilities)) { goto end;//primitive container } @@ -599,9 +630,8 @@ v1beta1_pod_security_policy_spec_t *v1beta1_pod_security_policy_spec_parseFromJS // v1beta1_pod_security_policy_spec->allowed_flex_volumes cJSON *allowed_flex_volumes = cJSON_GetObjectItemCaseSensitive(v1beta1_pod_security_policy_specJSON, "allowedFlexVolumes"); - list_t *allowed_flex_volumesList; if (allowed_flex_volumes) { - cJSON *allowed_flex_volumes_local_nonprimitive; + cJSON *allowed_flex_volumes_local_nonprimitive = NULL; if(!cJSON_IsArray(allowed_flex_volumes)){ goto end; //nonprimitive container } @@ -621,9 +651,8 @@ v1beta1_pod_security_policy_spec_t *v1beta1_pod_security_policy_spec_parseFromJS // v1beta1_pod_security_policy_spec->allowed_host_paths cJSON *allowed_host_paths = cJSON_GetObjectItemCaseSensitive(v1beta1_pod_security_policy_specJSON, "allowedHostPaths"); - list_t *allowed_host_pathsList; if (allowed_host_paths) { - cJSON *allowed_host_paths_local_nonprimitive; + cJSON *allowed_host_paths_local_nonprimitive = NULL; if(!cJSON_IsArray(allowed_host_paths)){ goto end; //nonprimitive container } @@ -643,9 +672,8 @@ v1beta1_pod_security_policy_spec_t *v1beta1_pod_security_policy_spec_parseFromJS // v1beta1_pod_security_policy_spec->allowed_proc_mount_types cJSON *allowed_proc_mount_types = cJSON_GetObjectItemCaseSensitive(v1beta1_pod_security_policy_specJSON, "allowedProcMountTypes"); - list_t *allowed_proc_mount_typesList; if (allowed_proc_mount_types) { - cJSON *allowed_proc_mount_types_local; + cJSON *allowed_proc_mount_types_local = NULL; if(!cJSON_IsArray(allowed_proc_mount_types)) { goto end;//primitive container } @@ -663,9 +691,8 @@ v1beta1_pod_security_policy_spec_t *v1beta1_pod_security_policy_spec_parseFromJS // v1beta1_pod_security_policy_spec->allowed_unsafe_sysctls cJSON *allowed_unsafe_sysctls = cJSON_GetObjectItemCaseSensitive(v1beta1_pod_security_policy_specJSON, "allowedUnsafeSysctls"); - list_t *allowed_unsafe_sysctlsList; if (allowed_unsafe_sysctls) { - cJSON *allowed_unsafe_sysctls_local; + cJSON *allowed_unsafe_sysctls_local = NULL; if(!cJSON_IsArray(allowed_unsafe_sysctls)) { goto end;//primitive container } @@ -683,9 +710,8 @@ v1beta1_pod_security_policy_spec_t *v1beta1_pod_security_policy_spec_parseFromJS // v1beta1_pod_security_policy_spec->default_add_capabilities cJSON *default_add_capabilities = cJSON_GetObjectItemCaseSensitive(v1beta1_pod_security_policy_specJSON, "defaultAddCapabilities"); - list_t *default_add_capabilitiesList; if (default_add_capabilities) { - cJSON *default_add_capabilities_local; + cJSON *default_add_capabilities_local = NULL; if(!cJSON_IsArray(default_add_capabilities)) { goto end;//primitive container } @@ -712,9 +738,8 @@ v1beta1_pod_security_policy_spec_t *v1beta1_pod_security_policy_spec_parseFromJS // v1beta1_pod_security_policy_spec->forbidden_sysctls cJSON *forbidden_sysctls = cJSON_GetObjectItemCaseSensitive(v1beta1_pod_security_policy_specJSON, "forbiddenSysctls"); - list_t *forbidden_sysctlsList; if (forbidden_sysctls) { - cJSON *forbidden_sysctls_local; + cJSON *forbidden_sysctls_local = NULL; if(!cJSON_IsArray(forbidden_sysctls)) { goto end;//primitive container } @@ -768,9 +793,8 @@ v1beta1_pod_security_policy_spec_t *v1beta1_pod_security_policy_spec_parseFromJS // v1beta1_pod_security_policy_spec->host_ports cJSON *host_ports = cJSON_GetObjectItemCaseSensitive(v1beta1_pod_security_policy_specJSON, "hostPorts"); - list_t *host_portsList; if (host_ports) { - cJSON *host_ports_local_nonprimitive; + cJSON *host_ports_local_nonprimitive = NULL; if(!cJSON_IsArray(host_ports)){ goto end; //nonprimitive container } @@ -808,9 +832,8 @@ v1beta1_pod_security_policy_spec_t *v1beta1_pod_security_policy_spec_parseFromJS // v1beta1_pod_security_policy_spec->required_drop_capabilities cJSON *required_drop_capabilities = cJSON_GetObjectItemCaseSensitive(v1beta1_pod_security_policy_specJSON, "requiredDropCapabilities"); - list_t *required_drop_capabilitiesList; if (required_drop_capabilities) { - cJSON *required_drop_capabilities_local; + cJSON *required_drop_capabilities_local = NULL; if(!cJSON_IsArray(required_drop_capabilities)) { goto end;//primitive container } @@ -867,9 +890,8 @@ v1beta1_pod_security_policy_spec_t *v1beta1_pod_security_policy_spec_parseFromJS // v1beta1_pod_security_policy_spec->volumes cJSON *volumes = cJSON_GetObjectItemCaseSensitive(v1beta1_pod_security_policy_specJSON, "volumes"); - list_t *volumesList; if (volumes) { - cJSON *volumes_local; + cJSON *volumes_local = NULL; if(!cJSON_IsArray(volumes)) { goto end;//primitive container } @@ -915,10 +937,100 @@ v1beta1_pod_security_policy_spec_t *v1beta1_pod_security_policy_spec_parseFromJS return v1beta1_pod_security_policy_spec_local_var; end: + if (allowed_csi_driversList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, allowed_csi_driversList) { + v1beta1_allowed_csi_driver_free(listEntry->data); + listEntry->data = NULL; + } + list_freeList(allowed_csi_driversList); + allowed_csi_driversList = NULL; + } + if (allowed_capabilitiesList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, allowed_capabilitiesList) { + free(listEntry->data); + listEntry->data = NULL; + } + list_freeList(allowed_capabilitiesList); + allowed_capabilitiesList = NULL; + } + if (allowed_flex_volumesList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, allowed_flex_volumesList) { + v1beta1_allowed_flex_volume_free(listEntry->data); + listEntry->data = NULL; + } + list_freeList(allowed_flex_volumesList); + allowed_flex_volumesList = NULL; + } + if (allowed_host_pathsList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, allowed_host_pathsList) { + v1beta1_allowed_host_path_free(listEntry->data); + listEntry->data = NULL; + } + list_freeList(allowed_host_pathsList); + allowed_host_pathsList = NULL; + } + if (allowed_proc_mount_typesList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, allowed_proc_mount_typesList) { + free(listEntry->data); + listEntry->data = NULL; + } + list_freeList(allowed_proc_mount_typesList); + allowed_proc_mount_typesList = NULL; + } + if (allowed_unsafe_sysctlsList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, allowed_unsafe_sysctlsList) { + free(listEntry->data); + listEntry->data = NULL; + } + list_freeList(allowed_unsafe_sysctlsList); + allowed_unsafe_sysctlsList = NULL; + } + if (default_add_capabilitiesList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, default_add_capabilitiesList) { + free(listEntry->data); + listEntry->data = NULL; + } + list_freeList(default_add_capabilitiesList); + default_add_capabilitiesList = NULL; + } + if (forbidden_sysctlsList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, forbidden_sysctlsList) { + free(listEntry->data); + listEntry->data = NULL; + } + list_freeList(forbidden_sysctlsList); + forbidden_sysctlsList = NULL; + } if (fs_group_local_nonprim) { v1beta1_fs_group_strategy_options_free(fs_group_local_nonprim); fs_group_local_nonprim = NULL; } + if (host_portsList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, host_portsList) { + v1beta1_host_port_range_free(listEntry->data); + listEntry->data = NULL; + } + list_freeList(host_portsList); + host_portsList = NULL; + } + if (required_drop_capabilitiesList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, required_drop_capabilitiesList) { + free(listEntry->data); + listEntry->data = NULL; + } + list_freeList(required_drop_capabilitiesList); + required_drop_capabilitiesList = NULL; + } if (run_as_group_local_nonprim) { v1beta1_run_as_group_strategy_options_free(run_as_group_local_nonprim); run_as_group_local_nonprim = NULL; @@ -939,6 +1051,15 @@ v1beta1_pod_security_policy_spec_t *v1beta1_pod_security_policy_spec_parseFromJS v1beta1_supplemental_groups_strategy_options_free(supplemental_groups_local_nonprim); supplemental_groups_local_nonprim = NULL; } + if (volumesList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, volumesList) { + free(listEntry->data); + listEntry->data = NULL; + } + list_freeList(volumesList); + volumesList = NULL; + } return NULL; } diff --git a/kubernetes/model/v1beta1_policy_rules_with_subjects.c b/kubernetes/model/v1beta1_policy_rules_with_subjects.c index c649b9af..18f74dd5 100644 --- a/kubernetes/model/v1beta1_policy_rules_with_subjects.c +++ b/kubernetes/model/v1beta1_policy_rules_with_subjects.c @@ -127,11 +127,19 @@ v1beta1_policy_rules_with_subjects_t *v1beta1_policy_rules_with_subjects_parseFr v1beta1_policy_rules_with_subjects_t *v1beta1_policy_rules_with_subjects_local_var = NULL; + // define the local list for v1beta1_policy_rules_with_subjects->non_resource_rules + list_t *non_resource_rulesList = NULL; + + // define the local list for v1beta1_policy_rules_with_subjects->resource_rules + list_t *resource_rulesList = NULL; + + // define the local list for v1beta1_policy_rules_with_subjects->subjects + list_t *subjectsList = NULL; + // v1beta1_policy_rules_with_subjects->non_resource_rules cJSON *non_resource_rules = cJSON_GetObjectItemCaseSensitive(v1beta1_policy_rules_with_subjectsJSON, "nonResourceRules"); - list_t *non_resource_rulesList; if (non_resource_rules) { - cJSON *non_resource_rules_local_nonprimitive; + cJSON *non_resource_rules_local_nonprimitive = NULL; if(!cJSON_IsArray(non_resource_rules)){ goto end; //nonprimitive container } @@ -151,9 +159,8 @@ v1beta1_policy_rules_with_subjects_t *v1beta1_policy_rules_with_subjects_parseFr // v1beta1_policy_rules_with_subjects->resource_rules cJSON *resource_rules = cJSON_GetObjectItemCaseSensitive(v1beta1_policy_rules_with_subjectsJSON, "resourceRules"); - list_t *resource_rulesList; if (resource_rules) { - cJSON *resource_rules_local_nonprimitive; + cJSON *resource_rules_local_nonprimitive = NULL; if(!cJSON_IsArray(resource_rules)){ goto end; //nonprimitive container } @@ -177,9 +184,8 @@ v1beta1_policy_rules_with_subjects_t *v1beta1_policy_rules_with_subjects_parseFr goto end; } - list_t *subjectsList; - cJSON *subjects_local_nonprimitive; + cJSON *subjects_local_nonprimitive = NULL; if(!cJSON_IsArray(subjects)){ goto end; //nonprimitive container } @@ -205,6 +211,33 @@ v1beta1_policy_rules_with_subjects_t *v1beta1_policy_rules_with_subjects_parseFr return v1beta1_policy_rules_with_subjects_local_var; end: + if (non_resource_rulesList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, non_resource_rulesList) { + v1beta1_non_resource_policy_rule_free(listEntry->data); + listEntry->data = NULL; + } + list_freeList(non_resource_rulesList); + non_resource_rulesList = NULL; + } + if (resource_rulesList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, resource_rulesList) { + v1beta1_resource_policy_rule_free(listEntry->data); + listEntry->data = NULL; + } + list_freeList(resource_rulesList); + resource_rulesList = NULL; + } + if (subjectsList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, subjectsList) { + v1beta1_subject_free(listEntry->data); + listEntry->data = NULL; + } + list_freeList(subjectsList); + subjectsList = NULL; + } return NULL; } diff --git a/kubernetes/model/v1beta1_priority_level_configuration_list.c b/kubernetes/model/v1beta1_priority_level_configuration_list.c index fe8e13c5..fae81a0a 100644 --- a/kubernetes/model/v1beta1_priority_level_configuration_list.c +++ b/kubernetes/model/v1beta1_priority_level_configuration_list.c @@ -116,6 +116,9 @@ v1beta1_priority_level_configuration_list_t *v1beta1_priority_level_configuratio v1beta1_priority_level_configuration_list_t *v1beta1_priority_level_configuration_list_local_var = NULL; + // define the local list for v1beta1_priority_level_configuration_list->items + list_t *itemsList = NULL; + // define the local variable for v1beta1_priority_level_configuration_list->metadata v1_list_meta_t *metadata_local_nonprim = NULL; @@ -134,9 +137,8 @@ v1beta1_priority_level_configuration_list_t *v1beta1_priority_level_configuratio goto end; } - list_t *itemsList; - cJSON *items_local_nonprimitive; + cJSON *items_local_nonprimitive = NULL; if(!cJSON_IsArray(items)){ goto end; //nonprimitive container } @@ -178,6 +180,15 @@ v1beta1_priority_level_configuration_list_t *v1beta1_priority_level_configuratio return v1beta1_priority_level_configuration_list_local_var; end: + if (itemsList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, itemsList) { + v1beta1_priority_level_configuration_free(listEntry->data); + listEntry->data = NULL; + } + list_freeList(itemsList); + itemsList = NULL; + } if (metadata_local_nonprim) { v1_list_meta_free(metadata_local_nonprim); metadata_local_nonprim = NULL; diff --git a/kubernetes/model/v1beta1_priority_level_configuration_status.c b/kubernetes/model/v1beta1_priority_level_configuration_status.c index 4f9e8137..82f52a31 100644 --- a/kubernetes/model/v1beta1_priority_level_configuration_status.c +++ b/kubernetes/model/v1beta1_priority_level_configuration_status.c @@ -67,11 +67,13 @@ v1beta1_priority_level_configuration_status_t *v1beta1_priority_level_configurat v1beta1_priority_level_configuration_status_t *v1beta1_priority_level_configuration_status_local_var = NULL; + // define the local list for v1beta1_priority_level_configuration_status->conditions + list_t *conditionsList = NULL; + // v1beta1_priority_level_configuration_status->conditions cJSON *conditions = cJSON_GetObjectItemCaseSensitive(v1beta1_priority_level_configuration_statusJSON, "conditions"); - list_t *conditionsList; if (conditions) { - cJSON *conditions_local_nonprimitive; + cJSON *conditions_local_nonprimitive = NULL; if(!cJSON_IsArray(conditions)){ goto end; //nonprimitive container } @@ -96,6 +98,15 @@ v1beta1_priority_level_configuration_status_t *v1beta1_priority_level_configurat return v1beta1_priority_level_configuration_status_local_var; end: + if (conditionsList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, conditionsList) { + v1beta1_priority_level_configuration_condition_free(listEntry->data); + listEntry->data = NULL; + } + list_freeList(conditionsList); + conditionsList = NULL; + } return NULL; } diff --git a/kubernetes/model/v1beta1_resource_policy_rule.c b/kubernetes/model/v1beta1_resource_policy_rule.c index 96cedb70..115126e1 100644 --- a/kubernetes/model/v1beta1_resource_policy_rule.c +++ b/kubernetes/model/v1beta1_resource_policy_rule.c @@ -158,15 +158,26 @@ v1beta1_resource_policy_rule_t *v1beta1_resource_policy_rule_parseFromJSON(cJSON v1beta1_resource_policy_rule_t *v1beta1_resource_policy_rule_local_var = NULL; + // define the local list for v1beta1_resource_policy_rule->api_groups + list_t *api_groupsList = NULL; + + // define the local list for v1beta1_resource_policy_rule->namespaces + list_t *namespacesList = NULL; + + // define the local list for v1beta1_resource_policy_rule->resources + list_t *resourcesList = NULL; + + // define the local list for v1beta1_resource_policy_rule->verbs + list_t *verbsList = NULL; + // v1beta1_resource_policy_rule->api_groups cJSON *api_groups = cJSON_GetObjectItemCaseSensitive(v1beta1_resource_policy_ruleJSON, "apiGroups"); if (!api_groups) { goto end; } - list_t *api_groupsList; - cJSON *api_groups_local; + cJSON *api_groups_local = NULL; if(!cJSON_IsArray(api_groups)) { goto end;//primitive container } @@ -192,9 +203,8 @@ v1beta1_resource_policy_rule_t *v1beta1_resource_policy_rule_parseFromJSON(cJSON // v1beta1_resource_policy_rule->namespaces cJSON *namespaces = cJSON_GetObjectItemCaseSensitive(v1beta1_resource_policy_ruleJSON, "namespaces"); - list_t *namespacesList; if (namespaces) { - cJSON *namespaces_local; + cJSON *namespaces_local = NULL; if(!cJSON_IsArray(namespaces)) { goto end;//primitive container } @@ -216,9 +226,8 @@ v1beta1_resource_policy_rule_t *v1beta1_resource_policy_rule_parseFromJSON(cJSON goto end; } - list_t *resourcesList; - cJSON *resources_local; + cJSON *resources_local = NULL; if(!cJSON_IsArray(resources)) { goto end;//primitive container } @@ -239,9 +248,8 @@ v1beta1_resource_policy_rule_t *v1beta1_resource_policy_rule_parseFromJSON(cJSON goto end; } - list_t *verbsList; - cJSON *verbs_local; + cJSON *verbs_local = NULL; if(!cJSON_IsArray(verbs)) { goto end;//primitive container } @@ -267,6 +275,42 @@ v1beta1_resource_policy_rule_t *v1beta1_resource_policy_rule_parseFromJSON(cJSON return v1beta1_resource_policy_rule_local_var; end: + if (api_groupsList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, api_groupsList) { + free(listEntry->data); + listEntry->data = NULL; + } + list_freeList(api_groupsList); + api_groupsList = NULL; + } + if (namespacesList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, namespacesList) { + free(listEntry->data); + listEntry->data = NULL; + } + list_freeList(namespacesList); + namespacesList = NULL; + } + if (resourcesList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, resourcesList) { + free(listEntry->data); + listEntry->data = NULL; + } + list_freeList(resourcesList); + resourcesList = NULL; + } + if (verbsList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, verbsList) { + free(listEntry->data); + listEntry->data = NULL; + } + list_freeList(verbsList); + verbsList = NULL; + } return NULL; } diff --git a/kubernetes/model/v1beta1_run_as_group_strategy_options.c b/kubernetes/model/v1beta1_run_as_group_strategy_options.c index fda95bf7..6695790c 100644 --- a/kubernetes/model/v1beta1_run_as_group_strategy_options.c +++ b/kubernetes/model/v1beta1_run_as_group_strategy_options.c @@ -83,11 +83,13 @@ v1beta1_run_as_group_strategy_options_t *v1beta1_run_as_group_strategy_options_p v1beta1_run_as_group_strategy_options_t *v1beta1_run_as_group_strategy_options_local_var = NULL; + // define the local list for v1beta1_run_as_group_strategy_options->ranges + list_t *rangesList = NULL; + // v1beta1_run_as_group_strategy_options->ranges cJSON *ranges = cJSON_GetObjectItemCaseSensitive(v1beta1_run_as_group_strategy_optionsJSON, "ranges"); - list_t *rangesList; if (ranges) { - cJSON *ranges_local_nonprimitive; + cJSON *ranges_local_nonprimitive = NULL; if(!cJSON_IsArray(ranges)){ goto end; //nonprimitive container } @@ -125,6 +127,15 @@ v1beta1_run_as_group_strategy_options_t *v1beta1_run_as_group_strategy_options_p return v1beta1_run_as_group_strategy_options_local_var; end: + if (rangesList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, rangesList) { + v1beta1_id_range_free(listEntry->data); + listEntry->data = NULL; + } + list_freeList(rangesList); + rangesList = NULL; + } return NULL; } diff --git a/kubernetes/model/v1beta1_run_as_user_strategy_options.c b/kubernetes/model/v1beta1_run_as_user_strategy_options.c index 85a87df3..11e97911 100644 --- a/kubernetes/model/v1beta1_run_as_user_strategy_options.c +++ b/kubernetes/model/v1beta1_run_as_user_strategy_options.c @@ -83,11 +83,13 @@ v1beta1_run_as_user_strategy_options_t *v1beta1_run_as_user_strategy_options_par v1beta1_run_as_user_strategy_options_t *v1beta1_run_as_user_strategy_options_local_var = NULL; + // define the local list for v1beta1_run_as_user_strategy_options->ranges + list_t *rangesList = NULL; + // v1beta1_run_as_user_strategy_options->ranges cJSON *ranges = cJSON_GetObjectItemCaseSensitive(v1beta1_run_as_user_strategy_optionsJSON, "ranges"); - list_t *rangesList; if (ranges) { - cJSON *ranges_local_nonprimitive; + cJSON *ranges_local_nonprimitive = NULL; if(!cJSON_IsArray(ranges)){ goto end; //nonprimitive container } @@ -125,6 +127,15 @@ v1beta1_run_as_user_strategy_options_t *v1beta1_run_as_user_strategy_options_par return v1beta1_run_as_user_strategy_options_local_var; end: + if (rangesList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, rangesList) { + v1beta1_id_range_free(listEntry->data); + listEntry->data = NULL; + } + list_freeList(rangesList); + rangesList = NULL; + } return NULL; } diff --git a/kubernetes/model/v1beta1_runtime_class_list.c b/kubernetes/model/v1beta1_runtime_class_list.c index ac1c4cbb..86e028ef 100644 --- a/kubernetes/model/v1beta1_runtime_class_list.c +++ b/kubernetes/model/v1beta1_runtime_class_list.c @@ -116,6 +116,9 @@ v1beta1_runtime_class_list_t *v1beta1_runtime_class_list_parseFromJSON(cJSON *v1 v1beta1_runtime_class_list_t *v1beta1_runtime_class_list_local_var = NULL; + // define the local list for v1beta1_runtime_class_list->items + list_t *itemsList = NULL; + // define the local variable for v1beta1_runtime_class_list->metadata v1_list_meta_t *metadata_local_nonprim = NULL; @@ -134,9 +137,8 @@ v1beta1_runtime_class_list_t *v1beta1_runtime_class_list_parseFromJSON(cJSON *v1 goto end; } - list_t *itemsList; - cJSON *items_local_nonprimitive; + cJSON *items_local_nonprimitive = NULL; if(!cJSON_IsArray(items)){ goto end; //nonprimitive container } @@ -178,6 +180,15 @@ v1beta1_runtime_class_list_t *v1beta1_runtime_class_list_parseFromJSON(cJSON *v1 return v1beta1_runtime_class_list_local_var; end: + if (itemsList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, itemsList) { + v1beta1_runtime_class_free(listEntry->data); + listEntry->data = NULL; + } + list_freeList(itemsList); + itemsList = NULL; + } if (metadata_local_nonprim) { v1_list_meta_free(metadata_local_nonprim); metadata_local_nonprim = NULL; diff --git a/kubernetes/model/v1beta1_runtime_class_strategy_options.c b/kubernetes/model/v1beta1_runtime_class_strategy_options.c index 36561137..74c8575f 100644 --- a/kubernetes/model/v1beta1_runtime_class_strategy_options.c +++ b/kubernetes/model/v1beta1_runtime_class_strategy_options.c @@ -80,15 +80,17 @@ v1beta1_runtime_class_strategy_options_t *v1beta1_runtime_class_strategy_options v1beta1_runtime_class_strategy_options_t *v1beta1_runtime_class_strategy_options_local_var = NULL; + // define the local list for v1beta1_runtime_class_strategy_options->allowed_runtime_class_names + list_t *allowed_runtime_class_namesList = NULL; + // v1beta1_runtime_class_strategy_options->allowed_runtime_class_names cJSON *allowed_runtime_class_names = cJSON_GetObjectItemCaseSensitive(v1beta1_runtime_class_strategy_optionsJSON, "allowedRuntimeClassNames"); if (!allowed_runtime_class_names) { goto end; } - list_t *allowed_runtime_class_namesList; - cJSON *allowed_runtime_class_names_local; + cJSON *allowed_runtime_class_names_local = NULL; if(!cJSON_IsArray(allowed_runtime_class_names)) { goto end;//primitive container } @@ -120,6 +122,15 @@ v1beta1_runtime_class_strategy_options_t *v1beta1_runtime_class_strategy_options return v1beta1_runtime_class_strategy_options_local_var; end: + if (allowed_runtime_class_namesList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, allowed_runtime_class_namesList) { + free(listEntry->data); + listEntry->data = NULL; + } + list_freeList(allowed_runtime_class_namesList); + allowed_runtime_class_namesList = NULL; + } return NULL; } diff --git a/kubernetes/model/v1beta1_scheduling.c b/kubernetes/model/v1beta1_scheduling.c index dc0cdaef..d7d7b825 100644 --- a/kubernetes/model/v1beta1_scheduling.c +++ b/kubernetes/model/v1beta1_scheduling.c @@ -99,11 +99,16 @@ v1beta1_scheduling_t *v1beta1_scheduling_parseFromJSON(cJSON *v1beta1_scheduling v1beta1_scheduling_t *v1beta1_scheduling_local_var = NULL; + // define the local map for v1beta1_scheduling->node_selector + list_t *node_selectorList = NULL; + + // define the local list for v1beta1_scheduling->tolerations + list_t *tolerationsList = NULL; + // v1beta1_scheduling->node_selector cJSON *node_selector = cJSON_GetObjectItemCaseSensitive(v1beta1_schedulingJSON, "nodeSelector"); - list_t *node_selectorList; if (node_selector) { - cJSON *node_selector_local_map; + cJSON *node_selector_local_map = NULL; if(!cJSON_IsObject(node_selector)) { goto end;//primitive map container } @@ -123,9 +128,8 @@ v1beta1_scheduling_t *v1beta1_scheduling_parseFromJSON(cJSON *v1beta1_scheduling // v1beta1_scheduling->tolerations cJSON *tolerations = cJSON_GetObjectItemCaseSensitive(v1beta1_schedulingJSON, "tolerations"); - list_t *tolerationsList; if (tolerations) { - cJSON *tolerations_local_nonprimitive; + cJSON *tolerations_local_nonprimitive = NULL; if(!cJSON_IsArray(tolerations)){ goto end; //nonprimitive container } @@ -151,6 +155,29 @@ v1beta1_scheduling_t *v1beta1_scheduling_parseFromJSON(cJSON *v1beta1_scheduling return v1beta1_scheduling_local_var; end: + if (node_selectorList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, node_selectorList) { + keyValuePair_t *localKeyValue = (keyValuePair_t*) listEntry->data; + free(localKeyValue->key); + localKeyValue->key = NULL; + free(localKeyValue->value); + localKeyValue->value = NULL; + keyValuePair_free(localKeyValue); + localKeyValue = NULL; + } + list_freeList(node_selectorList); + node_selectorList = NULL; + } + if (tolerationsList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, tolerationsList) { + v1_toleration_free(listEntry->data); + listEntry->data = NULL; + } + list_freeList(tolerationsList); + tolerationsList = NULL; + } return NULL; } diff --git a/kubernetes/model/v1beta1_supplemental_groups_strategy_options.c b/kubernetes/model/v1beta1_supplemental_groups_strategy_options.c index e0b705f8..e9803c15 100644 --- a/kubernetes/model/v1beta1_supplemental_groups_strategy_options.c +++ b/kubernetes/model/v1beta1_supplemental_groups_strategy_options.c @@ -81,11 +81,13 @@ v1beta1_supplemental_groups_strategy_options_t *v1beta1_supplemental_groups_stra v1beta1_supplemental_groups_strategy_options_t *v1beta1_supplemental_groups_strategy_options_local_var = NULL; + // define the local list for v1beta1_supplemental_groups_strategy_options->ranges + list_t *rangesList = NULL; + // v1beta1_supplemental_groups_strategy_options->ranges cJSON *ranges = cJSON_GetObjectItemCaseSensitive(v1beta1_supplemental_groups_strategy_optionsJSON, "ranges"); - list_t *rangesList; if (ranges) { - cJSON *ranges_local_nonprimitive; + cJSON *ranges_local_nonprimitive = NULL; if(!cJSON_IsArray(ranges)){ goto end; //nonprimitive container } @@ -120,6 +122,15 @@ v1beta1_supplemental_groups_strategy_options_t *v1beta1_supplemental_groups_stra return v1beta1_supplemental_groups_strategy_options_local_var; end: + if (rangesList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, rangesList) { + v1beta1_id_range_free(listEntry->data); + listEntry->data = NULL; + } + list_freeList(rangesList); + rangesList = NULL; + } return NULL; } diff --git a/kubernetes/model/v2beta1_horizontal_pod_autoscaler_list.c b/kubernetes/model/v2beta1_horizontal_pod_autoscaler_list.c index 017e5a50..46d20864 100644 --- a/kubernetes/model/v2beta1_horizontal_pod_autoscaler_list.c +++ b/kubernetes/model/v2beta1_horizontal_pod_autoscaler_list.c @@ -116,6 +116,9 @@ v2beta1_horizontal_pod_autoscaler_list_t *v2beta1_horizontal_pod_autoscaler_list v2beta1_horizontal_pod_autoscaler_list_t *v2beta1_horizontal_pod_autoscaler_list_local_var = NULL; + // define the local list for v2beta1_horizontal_pod_autoscaler_list->items + list_t *itemsList = NULL; + // define the local variable for v2beta1_horizontal_pod_autoscaler_list->metadata v1_list_meta_t *metadata_local_nonprim = NULL; @@ -134,9 +137,8 @@ v2beta1_horizontal_pod_autoscaler_list_t *v2beta1_horizontal_pod_autoscaler_list goto end; } - list_t *itemsList; - cJSON *items_local_nonprimitive; + cJSON *items_local_nonprimitive = NULL; if(!cJSON_IsArray(items)){ goto end; //nonprimitive container } @@ -178,6 +180,15 @@ v2beta1_horizontal_pod_autoscaler_list_t *v2beta1_horizontal_pod_autoscaler_list return v2beta1_horizontal_pod_autoscaler_list_local_var; end: + if (itemsList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, itemsList) { + v2beta1_horizontal_pod_autoscaler_free(listEntry->data); + listEntry->data = NULL; + } + list_freeList(itemsList); + itemsList = NULL; + } if (metadata_local_nonprim) { v1_list_meta_free(metadata_local_nonprim); metadata_local_nonprim = NULL; diff --git a/kubernetes/model/v2beta1_horizontal_pod_autoscaler_spec.c b/kubernetes/model/v2beta1_horizontal_pod_autoscaler_spec.c index c263e0fe..975a03a9 100644 --- a/kubernetes/model/v2beta1_horizontal_pod_autoscaler_spec.c +++ b/kubernetes/model/v2beta1_horizontal_pod_autoscaler_spec.c @@ -110,6 +110,9 @@ v2beta1_horizontal_pod_autoscaler_spec_t *v2beta1_horizontal_pod_autoscaler_spec v2beta1_horizontal_pod_autoscaler_spec_t *v2beta1_horizontal_pod_autoscaler_spec_local_var = NULL; + // define the local list for v2beta1_horizontal_pod_autoscaler_spec->metrics + list_t *metricsList = NULL; + // define the local variable for v2beta1_horizontal_pod_autoscaler_spec->scale_target_ref v2beta1_cross_version_object_reference_t *scale_target_ref_local_nonprim = NULL; @@ -127,9 +130,8 @@ v2beta1_horizontal_pod_autoscaler_spec_t *v2beta1_horizontal_pod_autoscaler_spec // v2beta1_horizontal_pod_autoscaler_spec->metrics cJSON *metrics = cJSON_GetObjectItemCaseSensitive(v2beta1_horizontal_pod_autoscaler_specJSON, "metrics"); - list_t *metricsList; if (metrics) { - cJSON *metrics_local_nonprimitive; + cJSON *metrics_local_nonprimitive = NULL; if(!cJSON_IsArray(metrics)){ goto end; //nonprimitive container } @@ -175,6 +177,15 @@ v2beta1_horizontal_pod_autoscaler_spec_t *v2beta1_horizontal_pod_autoscaler_spec return v2beta1_horizontal_pod_autoscaler_spec_local_var; end: + if (metricsList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, metricsList) { + v2beta1_metric_spec_free(listEntry->data); + listEntry->data = NULL; + } + list_freeList(metricsList); + metricsList = NULL; + } if (scale_target_ref_local_nonprim) { v2beta1_cross_version_object_reference_free(scale_target_ref_local_nonprim); scale_target_ref_local_nonprim = NULL; diff --git a/kubernetes/model/v2beta1_horizontal_pod_autoscaler_status.c b/kubernetes/model/v2beta1_horizontal_pod_autoscaler_status.c index f100b1ea..011f79f0 100644 --- a/kubernetes/model/v2beta1_horizontal_pod_autoscaler_status.c +++ b/kubernetes/model/v2beta1_horizontal_pod_autoscaler_status.c @@ -146,15 +146,20 @@ v2beta1_horizontal_pod_autoscaler_status_t *v2beta1_horizontal_pod_autoscaler_st v2beta1_horizontal_pod_autoscaler_status_t *v2beta1_horizontal_pod_autoscaler_status_local_var = NULL; + // define the local list for v2beta1_horizontal_pod_autoscaler_status->conditions + list_t *conditionsList = NULL; + + // define the local list for v2beta1_horizontal_pod_autoscaler_status->current_metrics + list_t *current_metricsList = NULL; + // v2beta1_horizontal_pod_autoscaler_status->conditions cJSON *conditions = cJSON_GetObjectItemCaseSensitive(v2beta1_horizontal_pod_autoscaler_statusJSON, "conditions"); if (!conditions) { goto end; } - list_t *conditionsList; - cJSON *conditions_local_nonprimitive; + cJSON *conditions_local_nonprimitive = NULL; if(!cJSON_IsArray(conditions)){ goto end; //nonprimitive container } @@ -173,9 +178,8 @@ v2beta1_horizontal_pod_autoscaler_status_t *v2beta1_horizontal_pod_autoscaler_st // v2beta1_horizontal_pod_autoscaler_status->current_metrics cJSON *current_metrics = cJSON_GetObjectItemCaseSensitive(v2beta1_horizontal_pod_autoscaler_statusJSON, "currentMetrics"); - list_t *current_metricsList; if (current_metrics) { - cJSON *current_metrics_local_nonprimitive; + cJSON *current_metrics_local_nonprimitive = NULL; if(!cJSON_IsArray(current_metrics)){ goto end; //nonprimitive container } @@ -247,6 +251,24 @@ v2beta1_horizontal_pod_autoscaler_status_t *v2beta1_horizontal_pod_autoscaler_st return v2beta1_horizontal_pod_autoscaler_status_local_var; end: + if (conditionsList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, conditionsList) { + v2beta1_horizontal_pod_autoscaler_condition_free(listEntry->data); + listEntry->data = NULL; + } + list_freeList(conditionsList); + conditionsList = NULL; + } + if (current_metricsList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, current_metricsList) { + v2beta1_metric_status_free(listEntry->data); + listEntry->data = NULL; + } + list_freeList(current_metricsList); + current_metricsList = NULL; + } return NULL; } diff --git a/kubernetes/model/v2beta2_horizontal_pod_autoscaler_list.c b/kubernetes/model/v2beta2_horizontal_pod_autoscaler_list.c index 6aacd637..0f599c2e 100644 --- a/kubernetes/model/v2beta2_horizontal_pod_autoscaler_list.c +++ b/kubernetes/model/v2beta2_horizontal_pod_autoscaler_list.c @@ -116,6 +116,9 @@ v2beta2_horizontal_pod_autoscaler_list_t *v2beta2_horizontal_pod_autoscaler_list v2beta2_horizontal_pod_autoscaler_list_t *v2beta2_horizontal_pod_autoscaler_list_local_var = NULL; + // define the local list for v2beta2_horizontal_pod_autoscaler_list->items + list_t *itemsList = NULL; + // define the local variable for v2beta2_horizontal_pod_autoscaler_list->metadata v1_list_meta_t *metadata_local_nonprim = NULL; @@ -134,9 +137,8 @@ v2beta2_horizontal_pod_autoscaler_list_t *v2beta2_horizontal_pod_autoscaler_list goto end; } - list_t *itemsList; - cJSON *items_local_nonprimitive; + cJSON *items_local_nonprimitive = NULL; if(!cJSON_IsArray(items)){ goto end; //nonprimitive container } @@ -178,6 +180,15 @@ v2beta2_horizontal_pod_autoscaler_list_t *v2beta2_horizontal_pod_autoscaler_list return v2beta2_horizontal_pod_autoscaler_list_local_var; end: + if (itemsList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, itemsList) { + v2beta2_horizontal_pod_autoscaler_free(listEntry->data); + listEntry->data = NULL; + } + list_freeList(itemsList); + itemsList = NULL; + } if (metadata_local_nonprim) { v1_list_meta_free(metadata_local_nonprim); metadata_local_nonprim = NULL; diff --git a/kubernetes/model/v2beta2_horizontal_pod_autoscaler_spec.c b/kubernetes/model/v2beta2_horizontal_pod_autoscaler_spec.c index 1619252a..96ed96ee 100644 --- a/kubernetes/model/v2beta2_horizontal_pod_autoscaler_spec.c +++ b/kubernetes/model/v2beta2_horizontal_pod_autoscaler_spec.c @@ -132,6 +132,9 @@ v2beta2_horizontal_pod_autoscaler_spec_t *v2beta2_horizontal_pod_autoscaler_spec // define the local variable for v2beta2_horizontal_pod_autoscaler_spec->behavior v2beta2_horizontal_pod_autoscaler_behavior_t *behavior_local_nonprim = NULL; + // define the local list for v2beta2_horizontal_pod_autoscaler_spec->metrics + list_t *metricsList = NULL; + // define the local variable for v2beta2_horizontal_pod_autoscaler_spec->scale_target_ref v2beta2_cross_version_object_reference_t *scale_target_ref_local_nonprim = NULL; @@ -155,9 +158,8 @@ v2beta2_horizontal_pod_autoscaler_spec_t *v2beta2_horizontal_pod_autoscaler_spec // v2beta2_horizontal_pod_autoscaler_spec->metrics cJSON *metrics = cJSON_GetObjectItemCaseSensitive(v2beta2_horizontal_pod_autoscaler_specJSON, "metrics"); - list_t *metricsList; if (metrics) { - cJSON *metrics_local_nonprimitive; + cJSON *metrics_local_nonprimitive = NULL; if(!cJSON_IsArray(metrics)){ goto end; //nonprimitive container } @@ -208,6 +210,15 @@ v2beta2_horizontal_pod_autoscaler_spec_t *v2beta2_horizontal_pod_autoscaler_spec v2beta2_horizontal_pod_autoscaler_behavior_free(behavior_local_nonprim); behavior_local_nonprim = NULL; } + if (metricsList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, metricsList) { + v2beta2_metric_spec_free(listEntry->data); + listEntry->data = NULL; + } + list_freeList(metricsList); + metricsList = NULL; + } if (scale_target_ref_local_nonprim) { v2beta2_cross_version_object_reference_free(scale_target_ref_local_nonprim); scale_target_ref_local_nonprim = NULL; diff --git a/kubernetes/model/v2beta2_horizontal_pod_autoscaler_status.c b/kubernetes/model/v2beta2_horizontal_pod_autoscaler_status.c index 82c9532e..7f7d0381 100644 --- a/kubernetes/model/v2beta2_horizontal_pod_autoscaler_status.c +++ b/kubernetes/model/v2beta2_horizontal_pod_autoscaler_status.c @@ -146,15 +146,20 @@ v2beta2_horizontal_pod_autoscaler_status_t *v2beta2_horizontal_pod_autoscaler_st v2beta2_horizontal_pod_autoscaler_status_t *v2beta2_horizontal_pod_autoscaler_status_local_var = NULL; + // define the local list for v2beta2_horizontal_pod_autoscaler_status->conditions + list_t *conditionsList = NULL; + + // define the local list for v2beta2_horizontal_pod_autoscaler_status->current_metrics + list_t *current_metricsList = NULL; + // v2beta2_horizontal_pod_autoscaler_status->conditions cJSON *conditions = cJSON_GetObjectItemCaseSensitive(v2beta2_horizontal_pod_autoscaler_statusJSON, "conditions"); if (!conditions) { goto end; } - list_t *conditionsList; - cJSON *conditions_local_nonprimitive; + cJSON *conditions_local_nonprimitive = NULL; if(!cJSON_IsArray(conditions)){ goto end; //nonprimitive container } @@ -173,9 +178,8 @@ v2beta2_horizontal_pod_autoscaler_status_t *v2beta2_horizontal_pod_autoscaler_st // v2beta2_horizontal_pod_autoscaler_status->current_metrics cJSON *current_metrics = cJSON_GetObjectItemCaseSensitive(v2beta2_horizontal_pod_autoscaler_statusJSON, "currentMetrics"); - list_t *current_metricsList; if (current_metrics) { - cJSON *current_metrics_local_nonprimitive; + cJSON *current_metrics_local_nonprimitive = NULL; if(!cJSON_IsArray(current_metrics)){ goto end; //nonprimitive container } @@ -247,6 +251,24 @@ v2beta2_horizontal_pod_autoscaler_status_t *v2beta2_horizontal_pod_autoscaler_st return v2beta2_horizontal_pod_autoscaler_status_local_var; end: + if (conditionsList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, conditionsList) { + v2beta2_horizontal_pod_autoscaler_condition_free(listEntry->data); + listEntry->data = NULL; + } + list_freeList(conditionsList); + conditionsList = NULL; + } + if (current_metricsList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, current_metricsList) { + v2beta2_metric_status_free(listEntry->data); + listEntry->data = NULL; + } + list_freeList(current_metricsList); + current_metricsList = NULL; + } return NULL; } diff --git a/kubernetes/model/v2beta2_hpa_scaling_rules.c b/kubernetes/model/v2beta2_hpa_scaling_rules.c index da25fd50..a835908d 100644 --- a/kubernetes/model/v2beta2_hpa_scaling_rules.c +++ b/kubernetes/model/v2beta2_hpa_scaling_rules.c @@ -91,11 +91,13 @@ v2beta2_hpa_scaling_rules_t *v2beta2_hpa_scaling_rules_parseFromJSON(cJSON *v2be v2beta2_hpa_scaling_rules_t *v2beta2_hpa_scaling_rules_local_var = NULL; + // define the local list for v2beta2_hpa_scaling_rules->policies + list_t *policiesList = NULL; + // v2beta2_hpa_scaling_rules->policies cJSON *policies = cJSON_GetObjectItemCaseSensitive(v2beta2_hpa_scaling_rulesJSON, "policies"); - list_t *policiesList; if (policies) { - cJSON *policies_local_nonprimitive; + cJSON *policies_local_nonprimitive = NULL; if(!cJSON_IsArray(policies)){ goto end; //nonprimitive container } @@ -140,6 +142,15 @@ v2beta2_hpa_scaling_rules_t *v2beta2_hpa_scaling_rules_parseFromJSON(cJSON *v2be return v2beta2_hpa_scaling_rules_local_var; end: + if (policiesList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, policiesList) { + v2beta2_hpa_scaling_policy_free(listEntry->data); + listEntry->data = NULL; + } + list_freeList(policiesList); + policiesList = NULL; + } return NULL; }