summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/common/core.c2
-rw-r--r--src/common/db.c8
-rw-r--r--src/map/log.h2
-rw-r--r--src/map/map.c28
-rw-r--r--src/map/npc.c2
-rw-r--r--src/map/pc.c4
-rw-r--r--src/map/pet.c2
-rw-r--r--src/map/script.c2
-rw-r--r--src/map/skill.c2
9 files changed, 27 insertions, 25 deletions
diff --git a/src/common/core.c b/src/common/core.c
index 50fadf646..948355469 100644
--- a/src/common/core.c
+++ b/src/common/core.c
@@ -131,7 +131,7 @@ static void sig_dump(int sn)
fprintf(fp,"End of stack trace\n");
fclose(fp);
- free(stack);
+ aFree(stack);
}
#endif
// When pass the signal to the system's default handler
diff --git a/src/common/db.c b/src/common/db.c
index 5eb73c785..71077ac06 100644
--- a/src/common/db.c
+++ b/src/common/db.c
@@ -364,12 +364,12 @@ void db_free_unlock(struct dbt *table) {
for(i = 0; i < table->free_count ; i++) {
db_rebalance_erase(table->free_list[i].z,table->free_list[i].root);
if(table->cmp == strdb_cmp) {
- free(table->free_list[i].z->key);
+ aFree(table->free_list[i].z->key);
}
#ifdef MALLOC_DBN
free_dbn(table->free_list[i].z);
#else
- free(table->free_list[i].z);
+ aFree(table->free_list[i].z);
#endif
table->item_count--;
}
@@ -406,7 +406,7 @@ struct dbn* db_insert(struct dbt *table,void* key,void* data)
} else {
table->free_count--;
if(table->cmp == strdb_cmp) {
- free(p->key);
+ aFree(p->key);
}
}
}
@@ -593,7 +593,7 @@ void db_final(struct dbt *table,int (*func)(void*,void*,va_list),...)
}
}
db_free_unlock(table);
- free(table->free_list);
+ aFree(table->free_list);
aFree(table);
va_end(ap);
}
diff --git a/src/map/log.h b/src/map/log.h
index 7130a8f6a..9886329da 100644
--- a/src/map/log.h
+++ b/src/map/log.h
@@ -29,6 +29,8 @@ extern struct Log_Config {
int branch, drop, mvpdrop, present, produce, refine, trade, vend, zeny, gm, npc;
char log_branch[32], log_drop[32], log_mvpdrop[32], log_present[32], log_produce[32], log_refine[32], log_trade[32], log_vend[32], log_gm[32], log_npc[32];
char log_branch_db[32], log_drop_db[32], log_mvpdrop_db[32], log_present_db[32], log_produce_db[32], log_refine_db[32], log_trade_db[32], log_vend_db[32], log_gm_db[32], log_npc_db[32];
+ int uptime;
+ char log_uptime[32];
} log_config;
#endif
diff --git a/src/map/map.c b/src/map/map.c
index f241c5fec..ae9933b11 100644
--- a/src/map/map.c
+++ b/src/map/map.c
@@ -1544,14 +1544,14 @@ int map_quit(struct map_session_data *sd) {
void *p = numdb_search(charid_db,sd->status.char_id);
if(p) {
numdb_erase(charid_db,sd->status.char_id);
- free(p);
+ aFree(p);
}
}
strdb_erase(nick_db,sd->status.name);
numdb_erase(charid_db,sd->status.char_id);
numdb_erase(id_db,sd->bl.id);
- free(sd->reg);
- free(sd->regstr);
+ aFree(sd->reg);
+ aFree(sd->regstr);
return 0;
}
@@ -1953,7 +1953,7 @@ int map_setipport(char *name,unsigned long ip,int port) {
} else {
// 読み込んでいるので置き換える
md = mdos->map;
- free(mdos);
+ aFree(mdos);
strdb_insert(map_db,md->name,md);
}
} else {
@@ -1973,7 +1973,7 @@ int map_eraseallipport_sub(void *key,void *data,va_list va) {
struct map_data_other_server *mdos = (struct map_data_other_server*)data;
if(mdos->gat == NULL && mdos->map == NULL) {
strdb_erase(map_db,key);
- free(mdos);
+ aFree(mdos);
}
return 0;
}
@@ -2005,7 +2005,7 @@ int map_eraseipport(char *name,unsigned long ip,int port)
return 1; // 呼び出し元で chrif_sendmap() をする
} else {
strdb_erase(map_db,name);
- free(mdos);
+ aFree(mdos);
}
// if(battle_config.etc_log)
// printf("erase map %s %d.%d.%d.%d:%d\n",name,p[0],p[1],p[2],p[3],port);
@@ -2179,7 +2179,7 @@ int map_cache_read(struct map_data *m)
return 1;
} else {
// なぜかファイル後半が欠けてるので読み直し
- m->xs = 0; m->ys = 0; m->gat = NULL; free(m->gat);
+ m->xs = 0; m->ys = 0; m->gat = NULL; aFree(m->gat);
return 0;
}
} else if(map_cache.map[i].compressed == 1) {
@@ -2195,19 +2195,19 @@ int map_cache_read(struct map_data *m)
if(fread(buf,1,size_compress,map_cache.fp) != size_compress) {
// なぜかファイル後半が欠けてるので読み直し
printf("fread error\n");
- free(m->gat); m->xs = 0; m->ys = 0; m->gat = NULL;
- free(buf);
+ aFree(m->gat); m->xs = 0; m->ys = 0; m->gat = NULL;
+ aFree(buf);
return 0;
}
dest_len = m->xs * m->ys;
decode_zip(m->gat,&dest_len,buf,size_compress);
if(dest_len != map_cache.map[i].xs * map_cache.map[i].ys) {
// 正常に解凍が出来てない
- free(m->gat); m->xs = 0; m->ys = 0; m->gat = NULL;
- free(buf);
+ aFree(m->gat); m->xs = 0; m->ys = 0; m->gat = NULL;
+ aFree(buf);
return 0;
}
- free(buf);
+ aFree(buf);
return 1;
}
}
@@ -2262,7 +2262,7 @@ static int map_cache_write(struct map_data *m)
map_cache.map[i].water_height = map_waterheight(m->name);
map_cache.dirty = 1;
if(map_read_flag == 2) {
- free(write_buf);
+ aFree(write_buf);
}
return 0;
}
@@ -2293,7 +2293,7 @@ static int map_cache_write(struct map_data *m)
map_cache.head.filesize += len_new;
map_cache.dirty = 1;
if(map_read_flag == 2) {
- free(write_buf);
+ aFree(write_buf);
}
return 0;
}
diff --git a/src/map/npc.c b/src/map/npc.c
index 89837da77..7634c0d0b 100644
--- a/src/map/npc.c
+++ b/src/map/npc.c
@@ -1889,7 +1889,7 @@ static int npc_parse_script(char *w1,char *w2,char *w3,char *w4,char *first_line
ev2 = strdb_search(ev_db,buf);
if(ev2 != NULL) {
printf("npc_parse_script : duplicate event %s\n",buf);
- free(ev2);
+ aFree(ev2);
}
strdb_insert(ev_db,buf,ev);
}
diff --git a/src/map/pc.c b/src/map/pc.c
index 282aa79c4..866ef969c 100644
--- a/src/map/pc.c
+++ b/src/map/pc.c
@@ -5849,7 +5849,7 @@ int pc_deleventtimer(struct map_session_data *sd,const char *name)
delete_timer(sd->eventtimer[i],pc_eventtimer);
sd->eventtimer[i]=-1;
sd->eventcount--;
- free(p);
+ aFree(p);
break;
}
}
@@ -5895,7 +5895,7 @@ int pc_cleareventtimer(struct map_session_data *sd)
char *p = (char *)(get_timer(sd->eventtimer[i])->data);
delete_timer(sd->eventtimer[i],pc_eventtimer);
sd->eventtimer[i]=-1;
- free(p);
+ aFree(p);
}
return 0;
diff --git a/src/map/pet.c b/src/map/pet.c
index c48f92970..6ec18422c 100644
--- a/src/map/pet.c
+++ b/src/map/pet.c
@@ -1682,7 +1682,7 @@ int do_final_pet(void) {
int i;
for(i = 0;i < MAX_PET_DB; i++) {
if(pet_db[i].script) {
- free(pet_db[i].script);
+ aFree(pet_db[i].script);
}
}
return 0;
diff --git a/src/map/script.c b/src/map/script.c
index 201635b8f..35964f3bc 100644
--- a/src/map/script.c
+++ b/src/map/script.c
@@ -6333,7 +6333,7 @@ int buildin_select(struct script_state *st)
strcat(buf,":");
}
clif_scriptmenu(script_rid2sd(st),st->oid,buf);
- free(buf);
+ aFree(buf);
} else if(sd->npc_menu==0xff){ // cansel
sd->state.menu_or_input=0;
st->state=END;
diff --git a/src/map/skill.c b/src/map/skill.c
index a8e158c71..6b95d391e 100644
--- a/src/map/skill.c
+++ b/src/map/skill.c
@@ -8565,7 +8565,7 @@ int skill_unit_move_unit_group( struct skill_unit_group *group, int m,int dx,int
&unit1->bl,tick,1);
}
}
- free(m_flag);
+ aFree(m_flag);
return 0;
}