projects
/
project
/
ubox.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
kmodloader: fix elf header parsing on 64bit machines
[project/ubox.git]
/
mount_root.c
diff --git
a/mount_root.c
b/mount_root.c
index ede5718f7bc082e3bcb6faa29c5653ccc18bd63c..8868e40c68203612f18e0a8e4da27f41d3ff8713 100644
(file)
--- a/
mount_root.c
+++ b/
mount_root.c
@@
-109,12
+109,16
@@
static char* find_mount(char *mp)
while (fgets(line, sizeof(line), fp)) {
char *s, *t = strstr(line, " ");
while (fgets(line, sizeof(line), fp)) {
char *s, *t = strstr(line, " ");
- if (!t)
+ if (!t) {
+ fclose(fp);
return NULL;
return NULL;
+ }
t++;
s = strstr(t, " ");
t++;
s = strstr(t, " ");
- if (!s)
+ if (!s) {
+ fclose(fp);
return NULL;
return NULL;
+ }
*s = '\0';
if (!strcmp(t, mp)) {
*s = '\0';
if (!strcmp(t, mp)) {
@@
-143,13
+147,16
@@
static char* find_mount_point(char *block, char *fs)
char *p = &line[len + 1];
char *t = strstr(p, " ");
char *p = &line[len + 1];
char *t = strstr(p, " ");
- if (!t)
+ if (!t) {
+ fclose(fp);
return NULL;
return NULL;
+ }
*t = '\0';
t++;
if (fs && strncmp(t, fs, strlen(fs))) {
*t = '\0';
t++;
if (fs && strncmp(t, fs, strlen(fs))) {
+ fclose(fp);
ERROR("block is mounted with wrong fs\n");
return NULL;
}
ERROR("block is mounted with wrong fs\n");
return NULL;
}