mirror of
https://github.com/systemd/systemd.git
synced 2024-10-28 03:25:31 +03:00
udev: rules - close empty file
If the file is found to be empty, we exit early without closing the file first. Found by coverity. Fixes CID #1237759.
This commit is contained in:
parent
6f42877282
commit
6c8aaf0c1b
Notes:
Lennart Poettering
2014-10-24 18:25:31 +02:00
Backport: bugfix
@ -1575,7 +1575,7 @@ invalid:
|
||||
}
|
||||
|
||||
static int parse_file(struct udev_rules *rules, const char *filename) {
|
||||
FILE *f;
|
||||
_cleanup_fclose_ FILE *f = NULL;
|
||||
unsigned int first_token;
|
||||
unsigned int filename_off;
|
||||
char line[UTIL_LINE_SIZE];
|
||||
@ -1633,7 +1633,6 @@ static int parse_file(struct udev_rules *rules, const char *filename) {
|
||||
}
|
||||
add_rule(rules, key, filename, filename_off, line_nr);
|
||||
}
|
||||
fclose(f);
|
||||
|
||||
/* link GOTOs to LABEL rules in this file to be able to fast-forward */
|
||||
for (i = first_token+1; i < rules->token_cur; i++) {
|
||||
|
Loading…
Reference in New Issue
Block a user