mirror of
https://github.com/mangosfour/server.git
synced 2025-12-15 01:37:00 +00:00
[12079] Remove some redundant explicit NULL checks for pointers before delete or delete[] calls since this check is done implicitly when deleting
Signed-off-by: stfx <stfx@hotmail.de>
This commit is contained in:
parent
4a684fe630
commit
21a3ee9267
28 changed files with 80 additions and 160 deletions
|
|
@ -169,7 +169,7 @@ QueryResult* SqlQueryHolder::GetResult(size_t index)
|
|||
/// the query strings are freed on the first GetResult or in the destructor
|
||||
if (m_queries[index].first != NULL)
|
||||
{
|
||||
delete [](const_cast<char*>(m_queries[index].first));
|
||||
delete[] (const_cast<char*>(m_queries[index].first));
|
||||
m_queries[index].first = NULL;
|
||||
}
|
||||
/// when you get a result aways remember to delete it!
|
||||
|
|
@ -194,9 +194,8 @@ SqlQueryHolder::~SqlQueryHolder()
|
|||
/// results used already (getresult called) are expected to be deleted
|
||||
if (m_queries[i].first != NULL)
|
||||
{
|
||||
delete [](const_cast<char*>(m_queries[i].first));
|
||||
if (m_queries[i].second)
|
||||
delete m_queries[i].second;
|
||||
delete[] (const_cast<char*>(m_queries[i].first));
|
||||
delete m_queries[i].second;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue