summaryrefslogtreecommitdiff
path: root/content/urldb.c
diff options
context:
space:
mode:
Diffstat (limited to 'content/urldb.c')
-rw-r--r--content/urldb.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/content/urldb.c b/content/urldb.c
index 68e39f10f..6b63eaa64 100644
--- a/content/urldb.c
+++ b/content/urldb.c
@@ -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;
}