projects
/
oweals
/
busybox.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
8578196
)
plug a DIR* leak on error path
author
Denys Vlasenko
<vda.linux@googlemail.com>
Tue, 28 Dec 2010 09:25:03 +0000
(10:25 +0100)
committer
Denys Vlasenko
<vda.linux@googlemail.com>
Tue, 28 Dec 2010 09:25:03 +0000
(10:25 +0100)
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
libbb/find_root_device.c
patch
|
blob
|
history
diff --git
a/libbb/find_root_device.c
b/libbb/find_root_device.c
index 32c86cea8e1de22f9262a74b91c24653e27fd416..8436cd664fcb28091299126baf82dfc5e3a59c4d 100644
(file)
--- a/
libbb/find_root_device.c
+++ b/
libbb/find_root_device.c
@@
-29,14
+29,15
@@
static char *find_block_device_in_dir(struct arena *ap)
char *retpath = NULL;
int len, rem;
- dir = opendir(ap->devpath);
- if (!dir)
- return NULL;
-
len = strlen(ap->devpath);
rem = DEVNAME_MAX-2 - len;
if (rem <= 0)
return NULL;
+
+ dir = opendir(ap->devpath);
+ if (!dir)
+ return NULL;
+
ap->devpath[len++] = '/';
while ((entry = readdir(dir)) != NULL) {