pulse-server: free pending sample reply

If the sample finished playing before we finished the roundtrip to
get the sink_index, it will be destroyed. When the roundtrip completes,
it will try to use invalid memoryy and crash.

Make sure we destroy all pending replies before destroying the sample
to avoid this problem.

Fixes #2151
This commit is contained in:
Wim Taymans 2022-02-20 21:34:53 +01:00
parent bf9ef440c3
commit d7793501fd
4 changed files with 20 additions and 0 deletions

View file

@ -66,6 +66,16 @@ void operation_free(struct operation *o)
free(o);
}
struct operation *operation_find(struct client *client, uint32_t tag)
{
struct operation *o;
spa_list_for_each(o, &client->operations, link) {
if (o->tag == tag)
return o;
}
return NULL;
}
void operation_complete(struct operation *o)
{
struct client *client = o->client;