mirror of
https://github.com/netsurf-browser/netsurf
synced 2025-01-10 21:12:01 +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;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!fgets(s, MAXIMUM_URL_LENGTH, fp))
|
if (!fgets(s, MAXIMUM_URL_LENGTH, fp)) {
|
||||||
|
fclose(fp);
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
version = atoi(s);
|
version = atoi(s);
|
||||||
if (version < MIN_URL_FILE_VERSION) {
|
if (version < MIN_URL_FILE_VERSION) {
|
||||||
LOG(("Unsupported URL file version."));
|
LOG(("Unsupported URL file version."));
|
||||||
|
fclose(fp);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (version > URL_FILE_VERSION) {
|
if (version > URL_FILE_VERSION) {
|
||||||
LOG(("Unknown URL file version."));
|
LOG(("Unknown URL file version."));
|
||||||
|
fclose(fp);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user