Follow up r16071 Fixed memory thing (if atcommand_suggestions_enabled was disabled it'd allocate the iterators but not free them.)

git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@16082 54d463be-8e91-2dee-dedb-b68131a5f0ec
This commit is contained in:
shennetsind 2012-05-05 04:03:25 +00:00
parent 3bf5adbb9b
commit a7d875ae98

View File

@ -8762,10 +8762,9 @@ static const char* atcommand_checkalias(const char *aliasname)
} }
/// AtCommand suggestion /// AtCommand suggestion
static void atcommand_get_suggestions(struct map_session_data* sd, const char *name, bool atcommand) static void atcommand_get_suggestions(struct map_session_data* sd, const char *name, bool atcommand) {
{ DBIterator* atcommand_iter;
DBIterator* atcommand_iter = db_iterator(atcommand_db); DBIterator* alias_iter;
DBIterator* alias_iter = db_iterator(atcommand_alias_db);
AtCommandInfo* command_info = NULL; AtCommandInfo* command_info = NULL;
AliasInfo* alias_info = NULL; AliasInfo* alias_info = NULL;
AtCommandType type; AtCommandType type;
@ -8775,6 +8774,9 @@ static void atcommand_get_suggestions(struct map_session_data* sd, const char *n
if (!battle_config.atcommand_suggestions_enabled) if (!battle_config.atcommand_suggestions_enabled)
return; return;
atcommand_iter = db_iterator(atcommand_db);
alias_iter = db_iterator(atcommand_alias_db);
if (atcommand) if (atcommand)
type = COMMAND_ATCOMMAND; type = COMMAND_ATCOMMAND;
else else