btrfs-progs: handle failed strdup in subvol_uuid_search2
Signed-off-by: David Sterba <dsterba@suse.com>
This commit is contained in:
parent
98203e8cdb
commit
e4fbe791e4
|
@ -501,6 +501,10 @@ struct subvol_info *subvol_uuid_search2(struct subvol_uuid_search *s,
|
|||
info->rtransid = btrfs_root_rtransid(&root_item);
|
||||
if (type == subvol_search_by_path) {
|
||||
info->path = strdup(path);
|
||||
if (!info->path) {
|
||||
ret = -ENOMEM;
|
||||
goto out;
|
||||
}
|
||||
} else {
|
||||
info->path = malloc(PATH_MAX);
|
||||
if (!info->path) {
|
||||
|
|
Loading…
Reference in New Issue