The allocation of printbuf_new might fail. Return NULL to indicate tis error to the caller. Otherwise later usage of the returned tokener would lead to null pointer dereference.