Skip to content

Commit

Permalink
sbus: free watch_fd->fdevent explicitly
Browse files Browse the repository at this point in the history
We never reproduced this with gdb but valgrind shows invalid read in sbus_watch_handler
after the watch_fd was freed. This should not be needed since watch_fd is memory parent
of fdevent but it seems to help.

Reviewed-by: Jakub Hrozek <jhrozek@redhat.com>
  • Loading branch information
pbrezina authored and jhrozek committed Sep 28, 2018
1 parent b821ee3 commit f1f9af5
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/sbus/connection/sbus_watch.c
Expand Up @@ -280,6 +280,7 @@ sbus_watch_remove(DBusWatch *dbus_watch, void *data)

if (watch_fd->dbus_watch.read == NULL
&& watch_fd->dbus_watch.write == NULL) {
talloc_free(watch_fd->fdevent);
talloc_free(watch_fd);
}
}
Expand Down

0 comments on commit f1f9af5

Please sign in to comment.