mirror of
https://github.com/vgough/encfs.git
synced 2024-12-29 10:09:20 +01:00
fix MemoryPool build with openssl
git-svn-id: http://encfs.googlecode.com/svn/trunk@101 db9cf616-1c43-0410-9cb8-a902689de0d6
This commit is contained in:
parent
2d90473d09
commit
b55fd2b010
@ -75,7 +75,7 @@ static byte *allocBlock(int size) {
|
||||
}
|
||||
|
||||
unsigned char cleanse_ctr = 0;
|
||||
static void cleanBlock(byte *data, int len) {
|
||||
static void freeBlock(byte *data, int len) {
|
||||
byte *p = data;
|
||||
size_t loop = len, ctr = cleanse_ctr;
|
||||
while(loop--)
|
||||
@ -88,6 +88,7 @@ static void cleanBlock(byte *data, int len) {
|
||||
if(p)
|
||||
ctr += (63 + (size_t)p);
|
||||
cleanse_ctr = (unsigned char)ctr;
|
||||
delete[] data;
|
||||
}
|
||||
|
||||
#endif
|
||||
@ -101,8 +102,7 @@ void MemBlock::allocate(int size)
|
||||
|
||||
MemBlock::~MemBlock()
|
||||
{
|
||||
cleanBlock(data, size);
|
||||
delete[] data;
|
||||
freeBlock(data, size);
|
||||
}
|
||||
|
||||
#ifdef WITH_BOTAN
|
||||
@ -147,8 +147,7 @@ SecureMem::~SecureMem()
|
||||
{
|
||||
if (size_)
|
||||
{
|
||||
cleanBlock(data_, size_);
|
||||
delete[] data_;
|
||||
freeBlock(data_, size_);
|
||||
munlock(data_, size_);
|
||||
|
||||
data_ = NULL;
|
||||
|
Loading…
Reference in New Issue
Block a user