#include <stdlib.h> struct foo *newfoo(void) { struct foo *ret = malloc(sizeof(struct foo)); if(ret == NULL) complain; memset(ret, 0, sizeof(struct foo)); return ret; }