summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorColin Walters <walters@verbum.org>2013-08-22 17:03:29 -0400
committerColin Walters <walters@verbum.org>2013-08-22 17:07:02 -0400
commit73814ca287cafcfa488f7ac85b25bc8584334db3 (patch)
tree300bf1573a216f7b6f448d4e943f2cc336461250
parentdf89481a35d4d7d58c7563f3082f67c218891375 (diff)
Revert "udevd: simplify sigterm check"
This reverts commit 47e737dc13bf4251ae5a2249ec29b34503ed92e1 - it introduced a use-after-free. The only way the code would get simpler is with a cleanup function, but eh, not worth it for just this one bit. Reviewed by kay on IRC.
-rw-r--r--src/udev/udevd.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/udev/udevd.c b/src/udev/udevd.c
index fd799cc910..7c6c5d6a87 100644
--- a/src/udev/udevd.c
+++ b/src/udev/udevd.c
@@ -314,10 +314,12 @@ static void worker_new(struct event *event)
udev_device_unref(dev);
dev = NULL;
- udev_event_unref(udev_event);
-
- if (udev_event->sigterm)
+ if (udev_event->sigterm) {
+ udev_event_unref(udev_event);
goto out;
+ }
+
+ udev_event_unref(udev_event);
/* wait for more device messages from main udevd, or term signal */
while (dev == NULL) {