mirror of
https://github.com/netsurf-browser/netsurf
synced 2025-01-10 13:03:09 +03:00
Ensure urldb file handle is closed on error.
svn path=/trunk/netsurf/; revision=9693
This commit is contained in:
parent
a042e38548
commit
63848419e2
@ -365,15 +365,20 @@ void urldb_load(const char *filename)
|
||||
return;
|
||||
}
|
||||
|
||||
if (!fgets(s, MAXIMUM_URL_LENGTH, fp))
|
||||
if (!fgets(s, MAXIMUM_URL_LENGTH, fp)) {
|
||||
fclose(fp);
|
||||
return;
|
||||
}
|
||||
|
||||
version = atoi(s);
|
||||
if (version < MIN_URL_FILE_VERSION) {
|
||||
LOG(("Unsupported URL file version."));
|
||||
fclose(fp);
|
||||
return;
|
||||
}
|
||||
if (version > URL_FILE_VERSION) {
|
||||
LOG(("Unknown URL file version."));
|
||||
fclose(fp);
|
||||
return;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user