[PATCH 1/3] Btrfs-progs: subvol_uuid_search: Return error on memory allocation failure

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Prasanth K S R <prasanth.ksr@xxxxxxxx>

This commit fixes coverity defect CID 1328695.

Signed-off-by: Prasanth K S R <prasanth.ksr@xxxxxxxx>
---
 send-utils.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/send-utils.c b/send-utils.c
index a85fa08..5026882 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);
 	}
-- 
2.10.2

--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Filesystem Development]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux