diff options
author | Haruna <haru@dotalux.com> | 2015-01-01 18:06:10 +0100 |
---|---|---|
committer | Haruna <haru@dotalux.com> | 2015-01-01 18:06:10 +0100 |
commit | ff607f15ec14783aed8c0cf2749ac8cbe6d0e7db (patch) | |
tree | e121e6c1e25ff47a26090437c937b022d2bfebc6 /src/map/party.c | |
parent | dc6b470e4aaf252cb4f960b8b5585e51da821893 (diff) | |
parent | f70d54001cd1b975db6f4668a6d54dbae7a8ac92 (diff) | |
download | hercules-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/party.c')
-rw-r--r-- | src/map/party.c | 31 |
1 files changed, 17 insertions, 14 deletions
diff --git a/src/map/party.c b/src/map/party.c index 668251b5d..1df916630 100644 --- a/src/map/party.c +++ b/src/map/party.c @@ -103,15 +103,17 @@ int party_db_final(DBKey key, DBData *data, va_list ap) { if( p->instance ) aFree(p->instance); - - for( j = 0; j < p->hdatac; j++ ) { - if( p->hdata[j]->flag.free ) { - aFree(p->hdata[j]->data); + + if (p->hdata) + { + for (j = 0; j < p->hdatac; j++) { + if (p->hdata[j]->flag.free) { + aFree(p->hdata[j]->data); + } + aFree(p->hdata[j]); } - aFree(p->hdata[j]); - } - if( p->hdata ) aFree(p->hdata); + } } return 0; @@ -609,15 +611,16 @@ int party_broken(int party_id) if( p->instance ) aFree(p->instance); - for( j = 0; j < p->hdatac; j++ ) { - if( p->hdata[j]->flag.free ) { - aFree(p->hdata[j]->data); - } - aFree(p->hdata[j]); - } if( p->hdata ) + { + for( j = 0; j < p->hdatac; j++ ) { + if( p->hdata[j]->flag.free ) { + aFree(p->hdata[j]->data); + } + aFree(p->hdata[j]); + } aFree(p->hdata); - + } idb_remove(party->db,party_id); return 0; } |