Skip to content

Commit 1f20234

Browse files
committed
[[CID 16816]] libfoundation: Fix release of incorrect variable.
On failing to allocate storage in __MCSetClone(), the value being cloned (`self`) was being released instead of the newly created clone value (`t_new_set`).
1 parent 307ebe0 commit 1f20234

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

libfoundation/src/foundation-set.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -276,7 +276,7 @@ static bool __MCSetClone(MCSetRef self, bool p_as_mutable, MCSetRef& r_new_self)
276276

277277
if (!MCMemoryNewArray(self -> limb_count, t_new_set -> limbs, t_new_set -> limb_count))
278278
{
279-
MCValueRelease(self);
279+
MCValueRelease(t_new_set);
280280
return false;
281281
}
282282

0 commit comments

Comments
 (0)