Skip to content

Commit

Permalink
make sure to return NULL for the query object when a response is retu…
Browse files Browse the repository at this point in the history
…rned from the cache (#3996)
  • Loading branch information
andreas-wehrmann committed Jun 20, 2024
1 parent ed52054 commit 3249dfb
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions pjlib-util/src/pjlib-util/resolver.c
Original file line number Diff line number Diff line change
Expand Up @@ -917,6 +917,12 @@ PJ_DEF(pj_status_t) pj_dns_resolver_start_query( pj_dns_resolver *resolver,
cache->ref_cnt++;
pj_grp_lock_release(resolver->grp_lock);

/* Since we're returning an answer from cache,
* there is no query object to return.
*/
if (p_query)
*p_query = NULL;

/* This cached response is still valid. Just return this
* response to caller.
*/
Expand Down

0 comments on commit 3249dfb

Please sign in to comment.