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);
|
info->rtransid = btrfs_root_rtransid(&root_item);
|
||||||
if (type == subvol_search_by_path) {
|
if (type == subvol_search_by_path) {
|
||||||
info->path = strdup(path);
|
info->path = strdup(path);
|
||||||
|
if (!info->path) {
|
||||||
|
ret = -ENOMEM;
|
||||||
|
goto out;
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
info->path = malloc(PATH_MAX);
|
info->path = malloc(PATH_MAX);
|
||||||
if (!info->path) {
|
if (!info->path) {
|
||||||
|
|
Loading…
Reference in New Issue