You shouldn't use assert to test the return value for malloc.


AREA *openarea(double a, double b, double c, double d)
{
AREA *area = malloc(sizeof *area);
assert(area != NULL);
...