raop: Fix callback call in raop client after auth : only call once everything is freed

This commit is contained in:
ckdo 2019-10-24 16:07:20 +02:00 committed by Georg Chini
parent 0c6678146a
commit 3e66643f50

View file

@ -1325,10 +1325,11 @@ static void rtsp_auth_cb(pa_rtsp_client *rtsp, pa_rtsp_state_t state, pa_rtsp_st
c->password = NULL; c->password = NULL;
} }
if (c->state_callback)
c->state_callback((int) PA_RAOP_AUTHENTICATED, c->state_userdata);
pa_rtsp_client_free(c->rtsp); pa_rtsp_client_free(c->rtsp);
c->rtsp = NULL; c->rtsp = NULL;
/* Ensure everything is cleaned before calling the callback, otherwise it may raise a crash */
if (c->state_callback)
c->state_callback((int) PA_RAOP_AUTHENTICATED, c->state_userdata);
waiting = false; waiting = false;
break; break;