Jump to content

ObscureAngel

Inactive Member
  • Posts

    5
  • Joined

  • Last visited

  • Feedback

    0%

Posts posted by ObscureAngel

  1. On Saturday, February 08, 2014 at 5:52 PM, Aveline™ said:
    
    	int pc_get_lang(lua_State* L)
    	{
    		char szQuery[QUERY_MAX_LEN];
    		LPCHARACTER ch = CQuestManager::instance().GetCurrentCharacterPtr();
    		snprintf(szQuery,sizeof(szQuery),"select lang from player%s where id = '%u'",get_table_postfix(),ch->GetPlayerID());
    		SQLMsg * pMsg = DBManager::instance().DirectQuery(szQuery);
    		MYSQL_ROW row;
    		for(int i = 0; (row = mysql_fetch_row(pMsg->Get()->pSQLResult)) != NULL; ++i)
    		{
    			lua_pushstring(L,row[0]);
    		}
    		return 1;
    	}

     

    Hi,

    pMsg is an allocated memory so it must be deleted.

×
×
  • Create New...

Important Information

Terms of Use / Privacy Policy / Guidelines / We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.