[Examples] Fix memory leak in example/list_pod

This commit is contained in:
Hui Yu
2020-06-01 12:00:58 +00:00
parent fb29e6c272
commit 82fb962911
3 changed files with 6 additions and 0 deletions

View File

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

View File

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

View File

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