Merge pull request #16 from ityuhui/yhmemleakfix

[Examples] Fix memory leak in example/list_pod
This commit is contained in:
Kubernetes Prow Robot
2020-06-01 07:59:55 -07:00
committed by GitHub
3 changed files with 6 additions and 0 deletions

View File

@@ -28,6 +28,8 @@ void list_pod(apiClient_t * apiClient)
pod = listEntry->data; pod = listEntry->data;
printf("\tThe pod name: %s\n", pod->metadata->name); printf("\tThe pod name: %s\n", pod->metadata->name);
} }
v1_pod_list_free(pod_list);
pod_list = NULL;
} else { } else {
printf("Cannot get any pod.\n"); printf("Cannot get any pod.\n");
} }

View File

@@ -28,6 +28,8 @@ void list_pod(apiClient_t * apiClient)
pod = listEntry->data; pod = listEntry->data;
printf("\tThe pod name: %s\n", pod->metadata->name); printf("\tThe pod name: %s\n", pod->metadata->name);
} }
v1_pod_list_free(pod_list);
pod_list = NULL;
} else { } else {
printf("Cannot get any pod.\n"); printf("Cannot get any pod.\n");
} }

View File

@@ -29,6 +29,8 @@ void list_pod(apiClient_t * apiClient)
pod = listEntry->data; pod = listEntry->data;
printf("\tThe pod name: %s\n", pod->metadata->name); printf("\tThe pod name: %s\n", pod->metadata->name);
} }
v1_pod_list_free(pod_list);
pod_list = NULL;
} else { } else {
printf("Cannot get any pod.\n"); printf("Cannot get any pod.\n");
} }