mirror of
https://gitlab.freedesktop.org/libinput/libei.git
synced 2026-01-06 17:40:14 +01:00
libeis: avoid a cleanup double-free
Aparently the compiler is not smart enough to handle the case correctly where a cleanup variable is introduced after a goto statement. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
This commit is contained in:
parent
b840c510bf
commit
fb115a1f43
1 changed files with 2 additions and 2 deletions
|
|
@ -397,6 +397,7 @@ client_dispatch(struct source *source, void *data)
|
|||
{
|
||||
struct eis_client *client = data;
|
||||
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));
|
||||
|
|
@ -405,8 +406,7 @@ client_dispatch(struct source *source, void *data)
|
|||
else if (rc < 0)
|
||||
goto error;
|
||||
|
||||
_cleanup_(message_freep) struct message *msg =
|
||||
client_parse_message(iobuf_data(buf), iobuf_len(buf));
|
||||
msg = client_parse_message(iobuf_data(buf), iobuf_len(buf));
|
||||
if (!msg) {
|
||||
rc = -EBADMSG;
|
||||
goto error;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue