summaryrefslogtreecommitdiff
path: root/send-utils.c
diff options
context:
space:
mode:
authorDavid Sterba <dsterba@suse.com>2016-12-12 17:53:31 +0100
committerDavid Sterba <dsterba@suse.com>2016-12-14 15:06:36 +0100
commite4fbe791e467d606e5ae303afed257d2506220fa (patch)
treea91188c1e7435fa4e71c15121309cd9ca2edc8f7 /send-utils.c
parent98203e8cdbee71c2da8ee59ab827a4bd5b30fae5 (diff)
btrfs-progs: handle failed strdup in subvol_uuid_search2
Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'send-utils.c')
-rw-r--r--send-utils.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/send-utils.c b/send-utils.c
index 8b7f2d31..384cc5b7 100644
--- a/send-utils.c
+++ b/send-utils.c
@@ -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) {