Skip to content

Commit 3249dfb

Browse files
make sure to return NULL for the query object when a response is returned from the cache (#3996)
1 parent ed52054 commit 3249dfb

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

pjlib-util/src/pjlib-util/resolver.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -917,6 +917,12 @@ PJ_DEF(pj_status_t) pj_dns_resolver_start_query( pj_dns_resolver *resolver,
917917
cache->ref_cnt++;
918918
pj_grp_lock_release(resolver->grp_lock);
919919

920+
/* Since we're returning an answer from cache,
921+
* there is no query object to return.
922+
*/
923+
if (p_query)
924+
*p_query = NULL;
925+
920926
/* This cached response is still valid. Just return this
921927
* response to caller.
922928
*/

0 commit comments

Comments
 (0)