summaryrefslogtreecommitdiff
path: root/udev/udevd.c
diff options
context:
space:
mode:
authorYin Kangkai <kangkai.yin@linux.intel.com>2010-08-02 18:31:18 +0800
committerKay Sievers <kay.sievers@vrfy.org>2010-08-02 12:37:55 +0200
commit1851332c08e3f70ee172bbe5b153789da5df2df5 (patch)
tree378ebd2d9b1e52435375ddf54e1abeb24ee18405 /udev/udevd.c
parent5047f82de4d3b973281993516441a35cebcf1294 (diff)
udevd: fix some memory leaks in error path
Signed-off-by: Yin Kangkai <kangkai.yin@intel.com>
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;