Whamcloud - gitweb
git://git.whamcloud.com
/
tools
/
e2fsprogs.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
9bcfea2
)
debugfs: handle out of memory condition
author
Tobias Stoeckmann
<tobias@stoeckmann.org>
Mon, 20 Jul 2015 14:52:28 +0000
(10:52 -0400)
committer
Theodore Ts'o
<tytso@mit.edu>
Wed, 22 Jul 2015 04:17:08 +0000
(
00:17
-0400)
If malloc fails, properly handle the error condition.
Signed-off-by: Tobias Stoeckmann <tobias@stoeckmann.org>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
debugfs/extent_inode.c
patch
|
blob
|
history
diff --git
a/debugfs/extent_inode.c
b/debugfs/extent_inode.c
index
8b22f5e
..
c7a92a7
100644
(file)
--- a/
debugfs/extent_inode.c
+++ b/
debugfs/extent_inode.c
@@
-97,6
+97,11
@@
void do_extent_open(int argc, char *argv[])
orig_prompt = ss_get_prompt(sci_idx);
extent_prompt = malloc(strlen(orig_prompt) + 32);
+ if (extent_prompt == NULL) {
+ com_err(argv[1], retval, "out of memory");
+ return;
+ }
+
strcpy(extent_prompt, orig_prompt);
cp = strchr(extent_prompt, ':');
if (cp)