malloc C问题
#include<stdio.h>int main()
{
int T,i,j,a,b,n,F[10],*p;
scanf("%d",&T);
for(i=0;i<T;i++)
{
scanf("%d %d %d",&a,&b,&n);
p=(int*)malloc(sizeof(int)*n);
p[0]=a,p[1]=b;
for(j=2;j<n;j++)
{
p[j]=p[j-1]+p[j-2];
j++;
p[j]=p[j-1]+p[j-2]+p[j-3];
}
F[i]=p[n-1];
p=NULL;
}
for(i=0;i<T;i++)
printf("%d\n",F[i]);
}
Main: malloc.c:3096: sYSMALLOc: Assertion `(old_top == (((mbinptr) (((char *) &((av)->bins[((1) - 1) * 2])) - __builtin_offsetof (struct malloc_chunk, fd)))) && old_size == 0) || ((unsigned long) (old_size) >= (unsigned long)((((__builtin_offsetof (struct malloc_chunk, fd_nextsize))+((2 * (sizeof(size_t))) - 1)) & ~((2 * (sizeof(size_t))) - 1))) && ((old_top)->size & 0x1) && ((unsigned long)old_end & pagemask) == 0)' failed.
Runtime Error:[ERROR] A Not allowed system call: runid:7662 callid:175
求大神解决