summaryrefslogtreecommitdiff
path: root/secblock.h
diff options
context:
space:
mode:
Diffstat (limited to 'secblock.h')
-rw-r--r--secblock.h4
1 files changed, 1 insertions, 3 deletions
diff --git a/secblock.h b/secblock.h
index 6ba0656..4e082b8 100644
--- a/secblock.h
+++ b/secblock.h
@@ -71,11 +71,9 @@ typename A::pointer StandardReallocate(A& a, T *p, typename A::size_type oldSize
if (preserve)
{
- A b;
- typename A::pointer newPointer = b.allocate(newSize, NULL);
+ typename A::pointer newPointer = a.allocate(newSize, NULL);
memcpy_s(newPointer, sizeof(T)*newSize, p, sizeof(T)*STDMIN(oldSize, newSize));
a.deallocate(p, oldSize);
- std::swap(a, b);
return newPointer;
}
else