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:
1d9ec88
)
misc/fsck: fix potential memory leak on error path
author
Theodore Ts'o
<tytso@mit.edu>
Sun, 11 Mar 2018 00:44:37 +0000
(19:44 -0500)
committer
Theodore Ts'o
<tytso@mit.edu>
Sun, 11 Mar 2018 02:23:16 +0000
(21:23 -0500)
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
misc/fsck.c
patch
|
blob
|
history
diff --git
a/misc/fsck.c
b/misc/fsck.c
index
a2e0dfb
..
cd23537
100644
(file)
--- a/
misc/fsck.c
+++ b/
misc/fsck.c
@@
-441,13
+441,14
@@
static int execute(const char *type, const char *device, const char *mntpt,
struct fsck_instance *inst, *p;
pid_t pid;
+ if (snprintf(prog, sizeof(prog), "fsck.%s", type) >= sizeof(prog))
+ return EINVAL;
+
inst = malloc(sizeof(struct fsck_instance));
if (!inst)
return ENOMEM;
memset(inst, 0, sizeof(struct fsck_instance));
- if (snprintf(prog, sizeof(prog), "fsck.%s", type) >= sizeof(prog))
- return EINVAL;
argv[0] = string_copy(prog);
argc = 1;