summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPrasanth K S R <prasanth.ksr@dell.com>2016-12-10 19:17:42 +0530
committerDavid Sterba <dsterba@suse.com>2016-12-14 15:06:36 +0100
commitadc1e90fb4d28f4873a3786db457ca9769c935a5 (patch)
tree553dc6bed14b42bda62faf4099ce813cdf0efe55
parentc9d43f2f3dd0976c1ce1e8e4cd1213c59384ff23 (diff)
btrfs-progs: subvol_uuid_search: return error on memory allocation failure
This commit fixes coverity defect CID 1328695. Resolves-coverity-id: 1328695 Signed-off-by: Prasanth K S R <prasanth.ksr@dell.com> Signed-off-by: David Sterba <dsterba@suse.com>
-rw-r--r--send-utils.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/send-utils.c b/send-utils.c
index a85fa084..5026882a 100644
--- a/send-utils.c
+++ b/send-utils.c
@@ -486,6 +486,10 @@ struct subvol_info *subvol_uuid_search(struct subvol_uuid_search *s,
info->path = strdup(path);
} else {
info->path = malloc(PATH_MAX);
+ if (!info->path) {
+ ret = -ENOMEM;
+ goto out;
+ }
ret = btrfs_subvolid_resolve(s->mnt_fd, info->path,
PATH_MAX, root_id);
}