summaryrefslogtreecommitdiff
path: root/src/char/geoip.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/char/geoip.c')
-rw-r--r--src/char/geoip.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/char/geoip.c b/src/char/geoip.c
index 1268019e1..889958e16 100644
--- a/src/char/geoip.c
+++ b/src/char/geoip.c
@@ -136,7 +136,7 @@ void geoip_init(void)
geoip->final(false);
return;
}
- geoip->data->cache = aMalloc( (sizeof(geoip->data->cache) * bufa.st_size) );
+ geoip->data->cache = aMalloc(sizeof(unsigned char) * bufa.st_size);
if (fread(geoip->data->cache, sizeof(unsigned char), bufa.st_size, db) != bufa.st_size) {
ShowError("geoip_cache: Couldn't read all elements!\n");
fclose(db);
@@ -157,7 +157,10 @@ void geoip_init(void)
}
break;
} else {
- fseek(db, -4l, SEEK_CUR);
+ if (fseek(db, -4l, SEEK_CUR) != 0) {
+ db_type = 0;
+ break;
+ }
}
}