>>617
if ((s->stk = (double *)calloc(max, sizeof(double))) == NULL) {
でどうでしょうか?