From a51ee72d2eb40e9747418fa4de4d3a266ca0a4f5 Mon Sep 17 00:00:00 2001 From: Yu Watanabe Date: Fri, 20 Jan 2017 09:45:58 +0900 Subject: [PATCH] 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(-) 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(). */ -- 2.25.1