Closed minerba closed 2 years ago
malloc()
failure is a rare case, even if it happens, program should exit because the system can no longer provide enough memory. Memory leak is not the most important thing at this time.
It isn't a "fatal" problem. And I suspect valgrind can not detect this issue.
Thank you for reporting this issue.
Hi @ityuhui I understand about your reply that It is not a "fatal" problem.
Well, this problem will be fixed?
I won't fix this issue recently because it's a rare case.
If you have interest, would you like to do some investigation and give a proposal ?
@minerba if you look at some of the other fixes that @ityuhui has done in the C
generator (e.g. https://github.com/OpenAPITools/openapi-generator/pull/10756) it should be fairly straightforward to fix this issue (basically add free
calls before returning NULL
if malloc returns a NULL pointer.
I agree that for correctness, it is right to delete those pointers, but I also agree with @ityuhui that this is a rare case.
But if you fix the generator, we'd be happy to regenerate the code with the fix.
Thanks!
The Kubernetes project currently lacks enough contributors to adequately respond to all issues and PRs.
This bot triages issues and PRs according to the following rules:
lifecycle/stale
is appliedlifecycle/stale
was applied, lifecycle/rotten
is appliedlifecycle/rotten
was applied, the issue is closedYou can:
/remove-lifecycle stale
/lifecycle rotten
/close
Please send feedback to sig-contributor-experience at kubernetes/community.
/lifecycle stale
The Kubernetes project currently lacks enough active contributors to adequately respond to all issues and PRs.
This bot triages issues and PRs according to the following rules:
lifecycle/stale
is appliedlifecycle/stale
was applied, lifecycle/rotten
is appliedlifecycle/rotten
was applied, the issue is closedYou can:
/remove-lifecycle rotten
/close
Please send feedback to sig-contributor-experience at kubernetes/community.
/lifecycle rotten
Hi
I run valgrind with kubernetes c-client in my machine.
well ...
I found Memory Leak in all Api(v1_object_create() );
for example
v1_node_local_var = v1_node_create() but most parameters allocate dynamic memory in function.
if(v1_node_local_var == NULL) , Failed to malloc in v1_node_create
NULL is returned without parameter Free.
Most api are operating in this way.
I think this could be a fatal problem.