summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorYu Watanabe <watanabe.yu+github@gmail.com>2017-01-20 09:45:58 +0900
committerYu Watanabe <watanabe.yu+github@gmail.com>2017-01-23 13:59:21 +0900
commita51ee72d2eb40e9747418fa4de4d3a266ca0a4f5 (patch)
treecc1649d4d890568c3788acd91820a0c4ff556985 /src
parentb03ec0096037bddfe0ece2af9a6b14b61df02b34 (diff)
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.
Diffstat (limited to 'src')
-rw-r--r--src/core/mount.c2
1 files changed, 1 insertions, 1 deletions
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(). */