summaryrefslogtreecommitdiff
path: root/src/map/unit.c
diff options
context:
space:
mode:
authorHaruna <haru@dotalux.com>2015-01-01 18:06:10 +0100
committerHaruna <haru@dotalux.com>2015-01-01 18:06:10 +0100
commitff607f15ec14783aed8c0cf2749ac8cbe6d0e7db (patch)
treee121e6c1e25ff47a26090437c937b022d2bfebc6 /src/map/unit.c
parentdc6b470e4aaf252cb4f960b8b5585e51da821893 (diff)
parentf70d54001cd1b975db6f4668a6d54dbae7a8ac92 (diff)
downloadhercules-ff607f15ec14783aed8c0cf2749ac8cbe6d0e7db.tar.gz
hercules-ff607f15ec14783aed8c0cf2749ac8cbe6d0e7db.tar.bz2
hercules-ff607f15ec14783aed8c0cf2749ac8cbe6d0e7db.tar.xz
hercules-ff607f15ec14783aed8c0cf2749ac8cbe6d0e7db.zip
Merge pull request #425 from 4144/fixes
Different fixes after automatic checks
Diffstat (limited to 'src/map/unit.c')
-rw-r--r--src/map/unit.c28
1 files changed, 16 insertions, 12 deletions
diff --git a/src/map/unit.c b/src/map/unit.c
index a5bd282a9..deb061f78 100644
--- a/src/map/unit.c
+++ b/src/map/unit.c
@@ -2657,14 +2657,16 @@ int unit_free(struct block_list *bl, clr_type clrtype) {
sd->num_quests = sd->avail_quests = 0;
}
- for( k = 0; k < sd->hdatac; k++ ) {
- if( sd->hdata[k]->flag.free ) {
- aFree(sd->hdata[k]->data);
- }
- aFree(sd->hdata[k]);
- }
if( sd->hdata )
+ {
+ for( k = 0; k < sd->hdatac; k++ ) {
+ if( sd->hdata[k]->flag.free ) {
+ aFree(sd->hdata[k]->data);
+ }
+ aFree(sd->hdata[k]);
+ }
aFree(sd->hdata);
+ }
break;
}
case BL_PET:
@@ -2776,14 +2778,16 @@ int unit_free(struct block_list *bl, clr_type clrtype) {
if( md->tomb_nid )
mob->mvptomb_destroy(md);
- for (k = 0; k < md->hdatac; k++) {
- if( md->hdata[k]->flag.free ) {
- aFree(md->hdata[k]->data);
- }
- aFree(md->hdata[k]);
- }
if (md->hdata)
+ {
+ for (k = 0; k < md->hdatac; k++) {
+ if( md->hdata[k]->flag.free ) {
+ aFree(md->hdata[k]->data);
+ }
+ aFree(md->hdata[k]);
+ }
aFree(md->hdata);
+ }
break;
}
case BL_HOM: