mirror of
https://gitlab.freedesktop.org/libinput/libei.git
synced 2026-01-02 20:20:19 +01:00
libei: fix the source ref handling
Plugs a memleak in libeis where we don't care about the return value of the source_add_autoclose(). Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
This commit is contained in:
parent
ba9b0bb903
commit
42546acf3f
2 changed files with 3 additions and 2 deletions
|
|
@ -703,7 +703,8 @@ error:
|
|||
int
|
||||
ei_set_connection(struct ei *ei, int fd)
|
||||
{
|
||||
ei->source = source_add_autoclose(ei->sink, fd, connection_dispatch, ei);
|
||||
struct source *source = source_add_autoclose(ei->sink, fd, connection_dispatch, ei);
|
||||
ei->source = source_ref(source);
|
||||
if (!ei->source)
|
||||
return -ENOMEM;
|
||||
|
||||
|
|
|
|||
|
|
@ -118,7 +118,7 @@ source_add(struct sink *sink, int sourcefd,
|
|||
|
||||
list_append(&sink->sources, &source->link);
|
||||
|
||||
return source_ref(source);
|
||||
return source;
|
||||
}
|
||||
|
||||
struct source *
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue