Fix a NULL pointer access when sutting down esound/simple connections

If a connection is unlinked make sure the process_msg function doesn't
crash when a message is received afterwards.

Closes #463.
This commit is contained in:
Lennart Poettering 2009-03-04 04:00:00 +01:00
parent 869341729f
commit d09287d211
2 changed files with 6 additions and 0 deletions

View file

@ -1290,6 +1290,9 @@ static int connection_process_msg(pa_msgobject *o, int code, void*userdata, int6
connection *c = CONNECTION(o);
connection_assert_ref(c);
if (!c->protocol)
return -1;
switch (code) {
case CONNECTION_MESSAGE_REQUEST_DATA:
do_work(c);

View file

@ -283,6 +283,9 @@ static int connection_process_msg(pa_msgobject *o, int code, void*userdata, int6
connection *c = CONNECTION(o);
connection_assert_ref(c);
if (!c->protocol)
return -1;
switch (code) {
case CONNECTION_MESSAGE_REQUEST_DATA:
do_work(c);