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:
+1
-1
@@ -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(). */
|
||||
|
||||
Reference in New Issue
Block a user