From e4fbe791e467d606e5ae303afed257d2506220fa Mon Sep 17 00:00:00 2001 From: David Sterba Date: Mon, 12 Dec 2016 17:53:31 +0100 Subject: btrfs-progs: handle failed strdup in subvol_uuid_search2 Signed-off-by: David Sterba --- send-utils.c | 4 ++++ 1 file changed, 4 insertions(+) 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) { -- cgit v1.2.3