pulse-server: free message when resize fails

Based on patch by Peter Hutterer

Fixes !701
This commit is contained in:
Wim Taymans 2021-05-28 11:52:29 +02:00
parent 8892152b13
commit a138152bef

View file

@ -194,8 +194,10 @@ static struct message *message_alloc(struct impl *impl, uint32_t channel, uint32
msg->stat->n_allocated++;
msg->stat->n_accumulated++;
}
if (ensure_size(msg, size) < 0)
if (ensure_size(msg, size) < 0) {
message_free(impl, msg, false, true);
return NULL;
}
spa_zero(msg->extra);
msg->channel = channel;
msg->offset = 0;