projects
/
platform
/
upstream
/
btrfs-progs.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
057d6ea
)
btrfs-progs: check malloc() result
author
Kenji Okimoto
<okimoto@clear-code.com>
Thu, 15 Nov 2012 04:47:51 +0000
(13:47 +0900)
committer
David Sterba
<dsterba@suse.cz>
Thu, 17 Jan 2013 17:27:55 +0000
(18:27 +0100)
Signed-off-by: Kenji Okimoto <okimoto@clear-code.com>
disk-io.c
patch
|
blob
|
history
diff --git
a/disk-io.c
b/disk-io.c
index
32f45dc
..
c4d4631
100644
(file)
--- a/
disk-io.c
+++ b/
disk-io.c
@@
-458,6
+458,9
@@
static int find_and_setup_log_root(struct btrfs_root *tree_root,
u64 blocknr = btrfs_super_log_root(disk_super);
struct btrfs_root *log_root = malloc(sizeof(struct btrfs_root));
+ if (!log_root)
+ return -ENOMEM;
+
if (blocknr == 0) {
free(log_root);
return 0;