malloc申请内存后,另一个指针指向的内容被更改

######malloc申请内存后,函数的一个指针实参地址没变,但是指向的内容被破坏了

List_S* Init_S(char* s)
{
    char* a = s;
    List_S* temp = (List_S*)malloc(sizeof(List_S));
    char* b = s;
    temp->next = NULL;
    temp->data.s = s;
    printf("%s", s);
    printf("\n%s", temp->data.s);
    temp->data.list = NULL;
    return temp;
}

malloc前

img

malloc后

img

调试过后发现指针是在malloc后发生的问题
想问问这是什么类型的问题,如何解决和避免

原因:传入的实参为局部变量没有被保护。