mirror of
https://gitlab.freedesktop.org/libinput/libei.git
synced 2026-05-09 07:28:25 +02: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;
|
struct ei *ei = userdata;
|
||||||
enum ei_state old_state = ei->state;
|
enum ei_state old_state = ei->state;
|
||||||
_cleanup_(message_freep) struct message *msg = NULL;
|
|
||||||
|
|
||||||
_cleanup_iobuf_ struct iobuf *buf = iobuf_new(64);
|
_cleanup_iobuf_ struct iobuf *buf = iobuf_new(64);
|
||||||
int rc = iobuf_append_from_fd(buf, source_get_fd(source));
|
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)
|
if (len == 0)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
msg = connection_parse_message(data, len, &consumed);
|
_cleanup_(message_freep) struct message *msg =
|
||||||
|
connection_parse_message(data, len, &consumed);
|
||||||
if (!msg) {
|
if (!msg) {
|
||||||
rc = -EBADMSG;
|
rc = -EBADMSG;
|
||||||
goto error;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
log_debug(ei, "Message type %d\n", msg->type);
|
log_debug(ei, "Message type %d\n", msg->type);
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue