btrfs-progs: handle failed strdup in subvol_uuid_search2
authorDavid Sterba <dsterba@suse.com>
Mon, 12 Dec 2016 16:53:31 +0000 (17:53 +0100)
committerDavid Sterba <dsterba@suse.com>
Wed, 14 Dec 2016 14:06:36 +0000 (15:06 +0100)
Signed-off-by: David Sterba <dsterba@suse.com>
send-utils.c

index 8b7f2d3..384cc5b 100644 (file)
@@ -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) {