From: Yu Watanabe Date: Fri, 20 Jan 2017 00:45:58 +0000 (+0900) Subject: core: minor error handling fix in mount_setup_new_unit() X-Git-Tag: v233~221^2~1 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=a51ee72d2eb40e9747418fa4de4d3a266ca0a4f5;p=thirdparty%2Fsystemd.git 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. --- diff --git a/src/core/mount.c b/src/core/mount.c index 8192a3616f7..fb08022ee03 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(). */