对不完整类型struct fruit 的sizeof应用无效
p=(struct fruit* )malloc(sizeof(struct fruit));
你的结构体啥样
结构体 struct fruit 怎么定义的?