From a51ee72d2eb40e9747418fa4de4d3a266ca0a4f5 Mon Sep 17 00:00:00 2001 From: Yu Watanabe Date: Fri, 20 Jan 2017 09:45:58 +0900 Subject: core: minor error handling fix in mount_setup_new_unit() The function mount_setup_new_unit() should return -ENOMEM if at least one of `strdup` calls are failed. --- src/core/mount.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/core/mount.c b/src/core/mount.c index 8192a3616f..fb08022ee0 100644 --- a/src/core/mount.c +++ b/src/core/mount.c @@ -1408,7 +1408,7 @@ static int mount_setup_new_unit( u->source_path = strdup("/proc/self/mountinfo"); MOUNT(u)->where = strdup(where); - if (!u->source_path && !MOUNT(u)->where) + if (!u->source_path || !MOUNT(u)->where) return -ENOMEM; /* Make sure to initialize those fields before mount_is_extrinsic(). */ -- cgit v1.2.3-54-g00ecf From cfcd431890e7b8cf6fb773a3d1c8ca86b52bfd99 Mon Sep 17 00:00:00 2001 From: Yu Watanabe Date: Fri, 20 Jan 2017 09:46:47 +0900 Subject: core: add missing unit_add_to_load_queue() to mount_setup_new_unit() unit_add_to_load_queue was present in the code before 03b8cfede9ff3441b1ec8ff5cdf6876294846aa4, and was inadvertently dropped. Fixes #5105 --- src/core/mount.c | 1 + 1 file changed, 1 insertion(+) (limited to 'src') diff --git a/src/core/mount.c b/src/core/mount.c index fb08022ee0..f2e22f9562 100644 --- a/src/core/mount.c +++ b/src/core/mount.c @@ -1435,6 +1435,7 @@ static int mount_setup_new_unit( return r; } + unit_add_to_load_queue(u); flags->is_mounted = true; flags->just_mounted = true; flags->just_changed = true; -- cgit v1.2.3-54-g00ecf