Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
dnsdist: Increment the DOHUnit ref count when it's set in the IDState #8471
We need to increment the reference counter even before sending the
This is why we love smart pointers, too bad that we need to deal with raw C pointers a bit in that code..
We need to increment the reference counter even before sending the query to the backend, as soon as we copy a reference into the IDState. Because: - that makes sense anyway, we are storing a new copy ; - otherwise, in the unlikely event where we reuse the IDState before the query has been sent to the backend we might free the DOHUnit before the reference counter has been incremented and cause a double-free.