Skip to content

free Error() #59

@minerba

Description

@minerba

@ityuhui

Hello,

I'm trying to Use pod_list_free(), But I have Error Message " free() : Invalid size "

so I trace function stack like below

#0  0x00007ffff69b57ff in raise () from /lib64/libc.so.6
#1  0x00007ffff699fc35 in abort () from /lib64/libc.so.6
#2  0x00007ffff69f8987 in __libc_message () from /lib64/libc.so.6
#3  0x00007ffff69ffd8c in malloc_printerr () from /lib64/libc.so.6
#4  0x00007ffff6a0169c in _int_free () from /lib64/libc.so.6
#5  0x00007ffff797bc42 in v1_pod_security_context_free (v1_pod_security_context=0x7da480)
    at kubernetes/model/v1_pod_security_context.c:51
#6  0x00007ffff797c842 in v1_pod_spec_free (v1_pod_spec=0x7dae40)
    at kubernetes/model/v1_pod_spec.c:214
#7  0x00007ffff797a0f3 in v1_pod_free (v1_pod=0x7db3f0)
    at kubernetes/model/v1_pod.c:52
#8  0x00007ffff797b779 in v1_pod_list_free (v1_pod_list=0x80f140)
    at kubernetes/model/v1_pod_list.c:38
#9  0x0000000000400893 in main (argc=1, argv=0x7fffffff55c8) at main.c:39

I don't know what the intent of this free()

free
void v1_pod_security_context_free(v1_pod_security_context_t *v1_pod_security_context)

=> if (v1_pod_security_context->supplemental_groups) {
list_ForEach(listEntry, v1_pod_security_context->supplemental_groups) {
free(listEntry->data);
}

allocate
kubernetes/model/v1_pod_security_context.c

v1_pod_security_context_parseFromJSON(cJSON *v1_pod_security_contextJSON)
=> list_addElement(supplemental_groupsList , &supplemental_groups_local->valuedouble);

So fixed not to call free function. It worked fine.

Is this right?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions