static int ldb_msg_add_winsdb_addr(struct ldb_message *msg, struct winsdb_record *rec,
				   const char *attr_name, struct winsdb_addr *addr)
{
	const char *str;

	if (rec->is_static) {
		str = talloc_strdup(msg, addr->address);
		if (!str) return LDB_ERR_OPERATIONS_ERROR;
	} else {
		char *expire_time;
		expire_time = ldb_timestring(msg, addr->expire_time);
		if (!expire_time) return LDB_ERR_OPERATIONS_ERROR;
		str = talloc_asprintf(msg, "%s;winsOwner:%s;expireTime:%s;",
				      addr->address, addr->wins_owner,
				      expire_time);
		talloc_free(expire_time);
		if (!str) return LDB_ERR_OPERATIONS_ERROR;
	}

	return ldb_msg_add_string(msg, attr_name, str);
}
static int ldb_msg_add_winsdb_addr(struct ldb_message *msg, struct winsdb_record *rec,
				   const char *attr_name, struct winsdb_addr *addr)
{
	const char *str;

	if (rec->is_static) {
		str = talloc_strdup(msg, addr->address);
		if (!str) return LDB_ERR_OPERATIONS_ERROR;
	} else {
		char *expire_time;
		expire_time = ldb_timestring(msg, addr->expire_time);
		if (!expire_time) return LDB_ERR_OPERATIONS_ERROR;
		str = talloc_asprintf(msg, "%s;winsOwner:%s;expireTime:%s;",
				      addr->address, addr->wins_owner,
				      expire_time);
		talloc_free(expire_time);
		if (!str) return LDB_ERR_OPERATIONS_ERROR;
	}

	return ldb_msg_add_string(msg, attr_name, str);
}