mirror of
https://gitlab.freedesktop.org/libinput/libei.git
synced 2025-12-25 19:50:06 +01:00
libei: plug a memleak if we get more than one message
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
This commit is contained in:
parent
515b67c6da
commit
7965e8f4df
1 changed files with 3 additions and 3 deletions
|
|
@ -716,7 +716,6 @@ connection_dispatch(struct source *source, void *userdata)
|
|||
{
|
||||
struct ei *ei = userdata;
|
||||
enum ei_state old_state = ei->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));
|
||||
|
|
@ -738,10 +737,11 @@ connection_dispatch(struct source *source, void *userdata)
|
|||
if (len == 0)
|
||||
break;
|
||||
|
||||
msg = connection_parse_message(data, len, &consumed);
|
||||
_cleanup_(message_freep) struct message *msg =
|
||||
connection_parse_message(data, len, &consumed);
|
||||
if (!msg) {
|
||||
rc = -EBADMSG;
|
||||
goto error;
|
||||
break;
|
||||
}
|
||||
|
||||
log_debug(ei, "Message type %d\n", msg->type);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue