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:
0121270
)
btrfs-progs: handle memory allocation error in cmd_device_stats
author
David Sterba
<dsterba@suse.com>
Mon, 2 May 2016 13:03:24 +0000
(15:03 +0200)
committer
David Sterba
<dsterba@suse.com>
Mon, 2 May 2016 13:03:24 +0000
(15:03 +0200)
Resolves-coverity-id: 1359012
Signed-off-by: David Sterba <dsterba@suse.com>
cmds-device.c
patch
|
blob
|
history
diff --git
a/cmds-device.c
b/cmds-device.c
index
5c0040c
..
1c886ad
100644
(file)
--- a/
cmds-device.c
+++ b/
cmds-device.c
@@
-450,6
+450,10
@@
static int cmd_device_stats(int argc, char **argv)
/* No path when device is missing. */
if (!canonical_path) {
canonical_path = malloc(32);
+ if (!canonical_path) {
+ error("not enough memory for path buffer");
+ goto out;
+ }
snprintf(canonical_path, 32,
"devid:%llu", args.devid);
}