use C99 initializers
replace malloc/memset with calloc and return NULL when the return type is a pointer and and the allocation failes
More C99 initaializers