From: <asf...@us...> - 2011-05-25 00:55:05
|
Revision: 53002 http://firebird.svn.sourceforge.net/firebird/?rev=53002&view=rev Author: asfernandes Date: 2011-05-25 00:54:59 +0000 (Wed, 25 May 2011) Log Message: ----------- Fix attachment leak due to variable shadow in isc_start_multiple. Modified Paths: -------------- firebird/trunk/src/yvalve/why.cpp Modified: firebird/trunk/src/yvalve/why.cpp =================================================================== --- firebird/trunk/src/yvalve/why.cpp 2011-05-25 00:45:14 UTC (rev 53001) +++ firebird/trunk/src/yvalve/why.cpp 2011-05-25 00:54:59 UTC (rev 53002) @@ -2993,11 +2993,11 @@ } HalfStaticArray<DtcStart, 16> dtcStartBuffer; - DtcStart* ds = dtcStartBuffer.getBuffer(count); + ds = dtcStartBuffer.getBuffer(count); memset(ds, 0, sizeof(DtcStart) * count); - DtcStart* p = ds; - DtcStart* const end = p + count; - for (; p < end; ++p, ++vector) + DtcStart* const end = ds + count; + + for (DtcStart* p = ds; p < end; ++p, ++vector) { RefPtr<YAttachment> attachment(translateHandle(attachments, vector->teb_database)); p->attachment = attachment; @@ -3023,14 +3023,12 @@ if (ds) { - DtcStart* p = ds; - DtcStart* const end = p + count; - for (; p < end; ++p) + DtcStart* const end = ds + count; + + for (DtcStart* p = ds; p < end; ++p) { if (p->attachment) - { p->attachment->release(); - } } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |