This makes sense but I'm trying to see exactly what goes wrong without it. Suppose path->query gets set to NULL between testing it and calling ib_sa_cancel_query(). What's the worst that can happen? It looks safe to ib_sa_cancel_query() with a stale or NULL query pointer. - R.