Don't free ret->data if malloc fails.