It is clear from surrounding code that this was attempting to allocate an array
of GLdouble *pointers*, not an array of GLdoubles. It is unlikely this would
have caused any noticeable issues as sizeof(GLdouble) is typically greater than
sizeof(GLdouble*), but nevertheless the calculation was incorrect. This change
not only corrects this, but uses the more appropriate calloc instead of malloc
for array allocation.
GLdouble** d;
int x=0;
- d= malloc(sizeof(GLdouble)* p->op.u.polygon.cnt);
+ d = calloc(p->op.u.polygon.cnt, sizeof(GLdouble*));
for (x=0;x < p->op.u.polygon.cnt; x++)
{
d[x]=malloc(sizeof(GLdouble)*3);