kubernetes-client / c

Official C client library for Kubernetes
Apache License 2.0
148 stars 47 forks source link

[Examples] Fix memory leak in example/list_pod #16

Closed ityuhui closed 4 years ago

ityuhui commented 4 years ago

Fix the issue #13

Release the memory of v1_pod_list_t *pod_list when it is not used in example/list_pod.

The check result of valgrind for the new code:

==10325== All heap blocks were freed -- no leaks are possible
ityuhui commented 4 years ago

/cc @brendandburns

brendandburns commented 4 years ago

/lgtm /approve

k8s-ci-robot commented 4 years ago

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: brendandburns, ityuhui

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files: - ~~[OWNERS](https://github.com/kubernetes-client/c/blob/master/OWNERS)~~ [brendandburns,ityuhui] Approvers can indicate their approval by writing `/approve` in a comment Approvers can cancel approval by writing `/approve cancel` in a comment