You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
eprosima::fastcdr::FastBuffer is not copy or move safe. It does not implement nor delete the default copy constructor, copy assignment operator, move constructor, or move assignment operator. If any one of those is used with an allocated buffer then the internal buffer will be freed twice.
#include<utility>
#include"fastcdr/FastBuffer.h"intmain()
{
// Copy assignment
{
eprosima::fastcdr::FastBuffer buffer1;
// Uncommenting this line causes double free at scope exit// buffer1.resize(1000);
eprosima::fastcdr::FastBuffer buffer2 = buffer1;
}
// Copy constructor
{
eprosima::fastcdr::FastBuffer buffer1;
// Uncommenting this line causes double free at scope exit// buffer1.resize(1000);
eprosima::fastcdr::FastBuffer buffer2(buffer1);
}
// Move assignment
{
eprosima::fastcdr::FastBuffer buffer1;
// Uncommenting this line causes double free at scope exit// buffer1.resize(1000);
eprosima::fastcdr::FastBuffer buffer2 = std::move(buffer1);
}
// Move constructor
{
eprosima::fastcdr::FastBuffer buffer1;
// Uncommenting this line causes double free at scope exit// buffer1.resize(1000);
eprosima::fastcdr::FastBuffer buffer2(std::move(buffer1));
}
return0;
}
The text was updated successfully, but these errors were encountered:
eprosima::fastcdr::FastBuffer
is not copy or move safe. It does not implement nor delete the default copy constructor, copy assignment operator, move constructor, or move assignment operator. If any one of those is used with an allocated buffer then the internal buffer will be freed twice.The text was updated successfully, but these errors were encountered: