summaryrefslogtreecommitdiff
path: root/src/map/atcommand.c
diff options
context:
space:
mode:
authorshennetsind <shennetsind@54d463be-8e91-2dee-dedb-b68131a5f0ec>2012-05-05 04:03:25 +0000
committershennetsind <shennetsind@54d463be-8e91-2dee-dedb-b68131a5f0ec>2012-05-05 04:03:25 +0000
commiteed57bf3368a01b0d8ac30ceaf788c168f6b763d (patch)
treedf6c16f18ac9b361c60e78118470ad8616eda1a7 /src/map/atcommand.c
parenta54a2cabaec5823b1719ca9fefc5e740505ed375 (diff)
downloadhercules-eed57bf3368a01b0d8ac30ceaf788c168f6b763d.tar.gz
hercules-eed57bf3368a01b0d8ac30ceaf788c168f6b763d.tar.bz2
hercules-eed57bf3368a01b0d8ac30ceaf788c168f6b763d.tar.xz
hercules-eed57bf3368a01b0d8ac30ceaf788c168f6b763d.zip
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://rathena.svn.sourceforge.net/svnroot/rathena/trunk@16082 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map/atcommand.c')
-rw-r--r--src/map/atcommand.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/map/atcommand.c b/src/map/atcommand.c
index 741513ca2..a20af53f7 100644
--- a/src/map/atcommand.c
+++ b/src/map/atcommand.c
@@ -8762,10 +8762,9 @@ static const char* atcommand_checkalias(const char *aliasname)
}
/// AtCommand suggestion
-static void atcommand_get_suggestions(struct map_session_data* sd, const char *name, bool atcommand)
-{
- DBIterator* atcommand_iter = db_iterator(atcommand_db);
- DBIterator* alias_iter = db_iterator(atcommand_alias_db);
+static void atcommand_get_suggestions(struct map_session_data* sd, const char *name, bool atcommand) {
+ DBIterator* atcommand_iter;
+ DBIterator* alias_iter;
AtCommandInfo* command_info = NULL;
AliasInfo* alias_info = NULL;
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)
return;
+ atcommand_iter = db_iterator(atcommand_db);
+ alias_iter = db_iterator(atcommand_alias_db);
+
if (atcommand)
type = COMMAND_ATCOMMAND;
else