Skip to content

Commit

Permalink
return NULL for the query object when no query has been started
Browse files Browse the repository at this point in the history
  • Loading branch information
andreas-wehrmann committed Jun 19, 2024
1 parent 0b84ef9 commit dd11255
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions pjlib-util/src/pjlib-util/srv_resolver.c
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ PJ_DEF(pj_status_t) pj_dns_srv_resolve( const pj_str_t *domain_name,
{
pj_size_t len;
pj_str_t target_name;
pj_dns_srv_async_query *query_job;
pj_dns_srv_async_query *query_job, *p_q = NULL;
pj_status_t status;

PJ_ASSERT_RETURN(domain_name && domain_name->slen &&
Expand Down Expand Up @@ -156,8 +156,11 @@ PJ_DEF(pj_status_t) pj_dns_srv_resolve( const pj_str_t *domain_name,
query_job->dns_state, 0,
&dns_callback,
query_job, &query_job->q_srv);
if (status==PJ_SUCCESS && p_query && query_job->q_srv)
*p_query = query_job;
if (query_job->q_srv)
p_q = query_job;

if (status==PJ_SUCCESS && p_query)
*p_query = p_q;

return status;
}
Expand Down

0 comments on commit dd11255

Please sign in to comment.