kubernetes-client / c

Official C client library for Kubernetes
Apache License 2.0
146 stars 46 forks source link

[Examples] Fix memory leak in example/create_pod #17

Closed ityuhui closed 4 years ago

ityuhui commented 4 years ago

Fix the issue #15

  1. Release the memory of v1_pod_t *podinfo when it is not used in example/creat_pod.
  2. Do not use the function v1_volume_mount_create to avoid coredump when v1_pod_free(podinfo) (The detail is described by #14)

The check result of valgrind for the new code:

==19567== 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