-
-
Notifications
You must be signed in to change notification settings - Fork 457
Open
Description
Help us help you
- I have checked that my issue doesn't exist yet.
- I have tried my absolute best to reduce the problem-space and have provided the absolute smallest test-case possible.
- I can always reproduce the issue with the provided description below.
Environment
- Operating System version:
- Game/AppID (with version if applicable):
- Current SourceMod version:
- Current SourceMod snapshot:
- Current Metamod: Source snapshot:
- I have updated SourceMod to the latest version and it still happens.
- I have updated SourceMod to the latest snapshot and it still happens.
- I have updated SourceMM to the latest snapshot and it still happens.
Description
I tested similar code in MySQL and it doesn't crash, so this only happens with pgsql
Problematic Code (or Steps to Reproduce)
...
char sClientIP[16], sError[256];
GetClientIP(client, sClientIP, sizeof(sClientIP));
DBStatement hInsertQuery;
FormatEx(g_sQuery, sizeof(g_sQuery), "INSERT INTO test_table (steamid, name, ip, firstjoin) VALUES ($1, $2, $3, $4) ON CONFLICT (steamid) DO NOTHING");
if ((hInsertQuery = SQL_PrepareQuery(g_hDataBase, g_sQuery, sError, sizeof(sError))) == null)
{
delete hInsertQuery;
LogError("Failed %s", sError);
return;
}
hInsertQuery.BindString(0, players[client].steamid, false);
hInsertQuery.BindString(1, players[client].name, false);
hInsertQuery.BindString(2, sClientIP, false);
hInsertQuery.BindInt(3, GetTime());
if (SQL_Execute(hInsertQuery))
{
PrintToServer("InsertQuery Success!");
}
delete hInsertQuery; // server crash
...Logs
server console
InsertQuery Success!
free(): invalid pointer
**server crash**
Metadata
Metadata
Assignees
Labels
No labels