summaryrefslogtreecommitdiff
path: root/udev/udevd.c
diff options
context:
space:
mode:
Diffstat (limited to 'udev/udevd.c')
-rw-r--r--udev/udevd.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/udev/udevd.c b/udev/udevd.c
index 873634fe45..fbc237143c 100644
--- a/udev/udevd.c
+++ b/udev/udevd.c
@@ -227,8 +227,10 @@ static void worker_new(struct event *event)
udev_monitor_enable_receiving(worker_monitor);
worker = calloc(1, sizeof(struct worker));
- if (worker == NULL)
+ if (worker == NULL) {
+ udev_monitor_unref(worker_monitor);
return;
+ }
/* worker + event reference */
worker->refcount = 2;
worker->udev = event->udev;