mirror of
https://github.com/pocoproject/poco.git
synced 2025-07-03 09:15:21 +02: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;
|
std::size_t totalSize = 0;
|
||||||
|
|
||||||
SQLLEN len;
|
SQLLEN len;
|
||||||
std::auto_ptr<char> apChar(new char[CHUNK_SIZE]);
|
char* pChar = 0;
|
||||||
char* pChar = apChar.get();
|
try
|
||||||
|
{
|
||||||
|
pChar = new char[CHUNK_SIZE];
|
||||||
SQLRETURN rc = 0;
|
SQLRETURN rc = 0;
|
||||||
|
|
||||||
val.clear();
|
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));
|
throw DataException(format(FLD_SIZE_EXCEEDED_FMT, fetchedSize, maxSize));
|
||||||
}while (true);
|
}while (true);
|
||||||
|
|
||||||
|
delete[] pChar;
|
||||||
return true;
|
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;
|
std::size_t totalSize = 0;
|
||||||
|
|
||||||
SQLLEN len;
|
SQLLEN len;
|
||||||
std::auto_ptr<char> apChar(new char[CHUNK_SIZE]);
|
char* pChar = 0;
|
||||||
char* pChar = apChar.get();
|
try
|
||||||
|
{
|
||||||
|
pChar = new char[CHUNK_SIZE];
|
||||||
SQLRETURN rc = 0;
|
SQLRETURN rc = 0;
|
||||||
|
|
||||||
val.clear();
|
val.clear();
|
||||||
@ -465,7 +476,14 @@ bool Extractor::extractManualImpl<Poco::Data::BLOB>(std::size_t pos,
|
|||||||
|
|
||||||
}while (true);
|
}while (true);
|
||||||
|
|
||||||
|
delete[] pChar;
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
|
} catch (...)
|
||||||
|
{
|
||||||
|
delete[] pChar;
|
||||||
|
throw;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user