Fix for possible memory leak when spawning bots

This commit is contained in:
Uleat
2018-02-19 07:34:43 -05:00
parent c36a1cd6dc
commit 765ee5eeed
4 changed files with 39 additions and 15 deletions
+4 -1
View File
@@ -273,7 +273,10 @@ bool BotDatabase::LoadBotID(const uint32 owner_id, const std::string& bot_name,
if (!owner_id || bot_name.empty())
return false;
query = StringFormat("SELECT `bot_id` FROM `bot_data` WHERE `name` = '%s' LIMIT 1", bot_name.c_str());
query = StringFormat(
"SELECT `bot_id` FROM `bot_data` WHERE `owner_id` = '%u' AND `name` = '%s' LIMIT 1",
owner_id, bot_name.c_str()
);
auto results = QueryDatabase(query);
if (!results.Success())
return false;