eta.c: check malloc return code