summaryrefslogtreecommitdiff
path: root/src/map/mob.c
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2014-12-25 21:41:07 +0300
committerAndrei Karas <akaras@inbox.ru>2014-12-31 23:06:29 +0300
commitf0d5be2db32afc7b4382276ffa3c60a1354bea8e (patch)
tree919fc1db442339a32a88bde0fa6f68e320e64dce /src/map/mob.c
parenta71a056abb8931aa4a11d0cde296fe9de68ee6df (diff)
downloadhercules-f0d5be2db32afc7b4382276ffa3c60a1354bea8e.tar.gz
hercules-f0d5be2db32afc7b4382276ffa3c60a1354bea8e.tar.bz2
hercules-f0d5be2db32afc7b4382276ffa3c60a1354bea8e.tar.xz
hercules-f0d5be2db32afc7b4382276ffa3c60a1354bea8e.zip
Add some missing null pointer checks after automatic checks.
Diffstat (limited to 'src/map/mob.c')
-rw-r--r--src/map/mob.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/src/map/mob.c b/src/map/mob.c
index 96ee83d3b..ce5854928 100644
--- a/src/map/mob.c
+++ b/src/map/mob.c
@@ -4716,14 +4716,16 @@ void mob_destroy_mob_db(int index)
{
struct mob_db *data = mob->db_data[index];
int v;
- for (v = 0; v < data->hdatac; v++ ) {
- if (data->hdata[v]->flag.free ) {
- aFree(data->hdata[v]->data);
- }
- aFree(data->hdata[v]);
- }
if (data->hdata)
+ {
+ for (v = 0; v < data->hdatac; v++ ) {
+ if (data->hdata[v]->flag.free ) {
+ aFree(data->hdata[v]->data);
+ }
+ aFree(data->hdata[v]);
+ }
aFree(data->hdata);
+ }
aFree(data);
mob->db_data[index] = NULL;
}