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.
This commit is contained in:
Yu Watanabe
2017-01-23 13:59:21 +09:00
parent b03ec00960
commit a51ee72d2e
+1 -1
View File
@@ -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(). */