]> git.ipfire.org Git - thirdparty/plymouth.git/commitdiff
ply-input-device: Fix crasher
authorRay Strode <rstrode@redhat.com>
Sun, 24 Dec 2023 20:27:49 +0000 (15:27 -0500)
committerRay Strode <rstrode@redhat.com>
Sun, 24 Dec 2023 20:42:31 +0000 (15:42 -0500)
If we have an error during early input device initialization we
can blow assertion because we may try to cleave it from the event
loop it is not yet attached to.

This commit fixes that.

src/libply-splash-core/ply-input-device.c

index 81a0b7e5b1788db4d0976182cd2fbda714786062..2e8a5a9006a98fadaead6f958c573217d55d8656 100644 (file)
@@ -558,7 +558,8 @@ ply_input_device_free (ply_input_device_t *input_device)
 
         free (input_device->path);
 
-        ply_event_loop_stop_watching_fd (input_device->loop, input_device->fd_watch);
+        if (input_device->fd_watch != NULL)
+                ply_event_loop_stop_watching_fd (input_device->loop, input_device->fd_watch);
 
         close (input_device->fd);