mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-10 10:08:18 +00:00
Fix memory leak in MySQL getBlob function
Direct leak of 768 byte(s) in 2 object(s) allocated from: #0 0x4e91ad in operator new(unsigned long) #1 0x7f0c54a3bf63 in sql::mysql::MySQL_Prepared_ResultSet::getBlob(unsigned int) const (/usr/lib/x86_64-linux-gnu/libmysqlcppconn.so.7+0x77f63)
This commit is contained in:
parent
c04621ea43
commit
aa53f28449
|
@ -306,7 +306,9 @@ int CMysqlConnection::GetBlob(int Col, unsigned char *pBuffer, int BufferSize) c
|
|||
#if defined(CONF_SQL)
|
||||
auto Blob = m_pResults->getBlob(Col);
|
||||
Blob->read((char *)pBuffer, BufferSize);
|
||||
return Blob->gcount();
|
||||
int NumRead = Blob->gcount();
|
||||
delete Blob;
|
||||
return NumRead;
|
||||
#else
|
||||
return 0;
|
||||
#endif
|
||||
|
|
Loading…
Reference in a new issue