bluez5-device: Fix memory leak in sco_process_render()
authorGeorg Chini <georg@chini.tk>
Wed, 9 May 2018 05:29:12 +0000 (07:29 +0200)
committerGeorg Chini <georg@chini.tk>
Wed, 9 May 2018 05:29:12 +0000 (07:29 +0200)
commit3b04539d5ee3c8a67c5a10c1b8ac87544ed58180
tree110f117ac4164b4428f4a7286f743bedfcbc5deb
parent192c3aaef8352ba9504aee4e311a23f6162d39d8
bluez5-device: Fix memory leak in sco_process_render()

sco_process_render does not unref the memblock when it encounters an error.

This patch fixes the issue. It also changes the return value to 1 in the case
of EAGAIN. Because the data was already rendered and cannot be re-sent, we
have to discard the block.

Because the modified EAGAIN handling prevents the log message about EAGAIN
after POLLOUT from being printed, the log message was moved to
a2dp/sco_process_render().
src/modules/bluetooth/module-bluez5-device.c