mirror of
https://github.com/kdave/btrfs-progs
synced 2025-01-11 08:19:32 +00:00
btrfs-progs: check malloc() result
Signed-off-by: Kenji Okimoto <okimoto@clear-code.com>
This commit is contained in:
parent
057d6ea34c
commit
1cce8d72f2
@ -458,6 +458,9 @@ static int find_and_setup_log_root(struct btrfs_root *tree_root,
|
|||||||
u64 blocknr = btrfs_super_log_root(disk_super);
|
u64 blocknr = btrfs_super_log_root(disk_super);
|
||||||
struct btrfs_root *log_root = malloc(sizeof(struct btrfs_root));
|
struct btrfs_root *log_root = malloc(sizeof(struct btrfs_root));
|
||||||
|
|
||||||
|
if (!log_root)
|
||||||
|
return -ENOMEM;
|
||||||
|
|
||||||
if (blocknr == 0) {
|
if (blocknr == 0) {
|
||||||
free(log_root);
|
free(log_root);
|
||||||
return 0;
|
return 0;
|
||||||
|
Loading…
Reference in New Issue
Block a user