Index: pjlib-util/src/pjlib-util/resolver.c =================================================================== --- a/pjlib-util/src/pjlib-util/resolver.c (revision 5476) +++ b/pjlib-util/src/pjlib-util/resolver.c (working copy) @@ -929,7 +929,12 @@ /* Must return PJ_SUCCESS */ status = PJ_SUCCESS; - goto on_return; + /* + * We cannot write to *p_query after calling cb because what + * p_query points to may have been freed by cb. + */ + pj_mutex_unlock(resolver->mutex); + return status; } /* At this point, we have a cached entry, but this entry has expired.