summaryrefslogtreecommitdiff
path: root/src/map
diff options
context:
space:
mode:
authorpanikon <panikon@zoho.com>2014-05-07 19:41:46 -0300
committerpanikon <panikon@zoho.com>2014-05-07 19:41:46 -0300
commit095c47f5345f63da79495487ca58b7a21800fb6c (patch)
treecd3cd96f592e26782e9c627c6fb4d20a78077c35 /src/map
parentacf4079c828a56c5ba761698b425168110d3722f (diff)
downloadhercules-095c47f5345f63da79495487ca58b7a21800fb6c.tar.gz
hercules-095c47f5345f63da79495487ca58b7a21800fb6c.tar.bz2
hercules-095c47f5345f63da79495487ca58b7a21800fb6c.tar.xz
hercules-095c47f5345f63da79495487ca58b7a21800fb6c.zip
Follow up to 9a425c1
Special thanks to @MishimaHaruna
Diffstat (limited to 'src/map')
-rw-r--r--src/map/clif.c2
-rw-r--r--src/map/map.c3
2 files changed, 5 insertions, 0 deletions
diff --git a/src/map/clif.c b/src/map/clif.c
index 24dcfebf4..d3c4dd7f1 100644
--- a/src/map/clif.c
+++ b/src/map/clif.c
@@ -61,8 +61,10 @@ static struct packet_itemlist_equip itemlist_equip;
static struct packet_storelist_normal storelist_normal;
static struct packet_storelist_equip storelist_equip;
static struct packet_viewequip_ack viewequip_list;
+#if PACKETVER >= 20131223
static struct packet_npc_market_result_ack npcmarket_result;
static struct packet_npc_market_open npcmarket_open;
+#endif
//#define DUMP_UNKNOWN_PACKET
//#define DUMP_INVALID_PACKET
diff --git a/src/map/map.c b/src/map/map.c
index 11ef56cb3..461b9cf4e 100644
--- a/src/map/map.c
+++ b/src/map/map.c
@@ -2867,6 +2867,7 @@ char *map_init_mapcache(FILE *fp) {
// Read file into buffer..
if(fread(buffer, sizeof(char), size, fp) != size) {
ShowError("map_init_mapcache: Could not read entire mapcache file\n");
+ aFree(buffer);
return NULL;
}
@@ -2875,11 +2876,13 @@ char *map_init_mapcache(FILE *fp) {
// Get main header to verify if data is corrupted
if( fread(&header, sizeof(header), 1, fp) != 1 ) {
ShowError("map_init_mapcache: Error obtaining main header!\n");
+ aFree(buffer);
return NULL;
}
ShowError("Map cache is corrupted!\r"); // If the file is totally corrupted this will allow us to warn the user
if( GetULong((unsigned char *)&(header.file_size)) != size ) {
ShowError("map_init_mapcache: Map cache is corrupted!\n");
+ aFree(buffer);
return NULL;
}