mirror of
https://github.com/pocoproject/poco.git
synced 2025-02-21 22:56:19 +01:00
SF [2019857] Memory leak in Data::ODBC Extractor
This commit is contained in:
parent
93c6bb0725
commit
f574e90f41
@ -368,8 +368,10 @@ bool Extractor::extractManualImpl<std::string>(std::size_t pos, std::string& val
|
||||
std::size_t totalSize = 0;
|
||||
|
||||
SQLLEN len;
|
||||
std::auto_ptr<char> apChar(new char[CHUNK_SIZE]);
|
||||
char* pChar = apChar.get();
|
||||
char* pChar = 0;
|
||||
try
|
||||
{
|
||||
pChar = new char[CHUNK_SIZE];
|
||||
SQLRETURN rc = 0;
|
||||
|
||||
val.clear();
|
||||
@ -410,7 +412,14 @@ bool Extractor::extractManualImpl<std::string>(std::size_t pos, std::string& val
|
||||
throw DataException(format(FLD_SIZE_EXCEEDED_FMT, fetchedSize, maxSize));
|
||||
}while (true);
|
||||
|
||||
delete[] pChar;
|
||||
return true;
|
||||
|
||||
} catch (...)
|
||||
{
|
||||
delete[] pChar;
|
||||
throw;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -424,8 +433,10 @@ bool Extractor::extractManualImpl<Poco::Data::BLOB>(std::size_t pos,
|
||||
std::size_t totalSize = 0;
|
||||
|
||||
SQLLEN len;
|
||||
std::auto_ptr<char> apChar(new char[CHUNK_SIZE]);
|
||||
char* pChar = apChar.get();
|
||||
char* pChar = 0;
|
||||
try
|
||||
{
|
||||
pChar = new char[CHUNK_SIZE];
|
||||
SQLRETURN rc = 0;
|
||||
|
||||
val.clear();
|
||||
@ -465,7 +476,14 @@ bool Extractor::extractManualImpl<Poco::Data::BLOB>(std::size_t pos,
|
||||
|
||||
}while (true);
|
||||
|
||||
delete[] pChar;
|
||||
return true;
|
||||
|
||||
} catch (...)
|
||||
{
|
||||
delete[] pChar;
|
||||
throw;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user