mirror of
https://gitlab.freedesktop.org/libinput/libei.git
synced 2026-05-06 11:48:03 +02:00
libeis: plug a memory leak if we get more than one message per dispatch
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
This commit is contained in:
parent
2e944450a0
commit
fb7bbbd4ce
1 changed files with 2 additions and 2 deletions
|
|
@ -618,8 +618,6 @@ client_dispatch(struct source *source, void *userdata)
|
|||
{
|
||||
struct eis_client *client = userdata;
|
||||
enum eis_client_state old_state = client->state;
|
||||
_cleanup_(message_freep) struct message *msg = NULL;
|
||||
|
||||
_cleanup_iobuf_ struct iobuf *buf = iobuf_new(64);
|
||||
int rc = iobuf_append_from_fd(buf, source_get_fd(source));
|
||||
if (rc == -EAGAIN) {
|
||||
|
|
@ -635,6 +633,8 @@ client_dispatch(struct source *source, void *userdata)
|
|||
|
||||
size_t idx = 0;
|
||||
while (rc == 0) {
|
||||
_cleanup_(message_freep) struct message *msg = NULL;
|
||||
|
||||
const char *data = iobuf_data(buf) + idx;
|
||||
size_t len = iobuf_len(buf) - idx;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue