Showing the changes to Source/Libraries/TimeSeriesPlatformLibrary/Data/DataRow.cpp (1 of 14 files). Show all
Unified · Split
| @@ -49,10 +49,7 @@ DataRow::DataRow(DataTablePtr parent) : · 48 unmodified lines | |||
| 49 | DataRow::~DataRow() | 49 | DataRow::~DataRow() |
| 50 | { | 50 | { |
| 51 | for (uint32_t i = 0; i < m_values.size(); i++) | 51 | for (uint32_t i = 0; i < m_values.size(); i++) |
| 52 | { | 52 | free(m_values[i]); |
| 53 | if (m_values[i]) | ||
| 54 | free(m_values[i]); | ||
| 55 | } | ||
| 56 | } | 53 | } |
| 57 | 54 | ||
| 58 | int32_t DataRow::GetColumnIndex(const string& columnName) const | 55 | int32_t DataRow::GetColumnIndex(const string& columnName) const |
| @@ -107,7 +104,10 @@ ValueExpressionPtr DataRow::EvaluateExpression(const DataColumnPtr& column) · 48 unmodified lines | |||
| 107 | const auto expressionTrees = parser->GetExpressionTrees(); | 104 | const auto expressionTrees = parser->GetExpressionTrees(); |
| 108 | 105 | ||
| 109 | if (expressionTrees.empty()) | 106 | if (expressionTrees.empty()) |
| 107 | { | ||
| 108 | delete parser; | ||
| 110 | throw DataSetException("Expression defined for computed DataColumn \"" + column->Name() + " for table \"" + m_parent->Name() + "\" cannot produce a value"); | 109 | throw DataSetException("Expression defined for computed DataColumn \"" + column->Name() + " for table \"" + m_parent->Name() + "\" cannot produce a value"); |
| 110 | } | ||
| 111 | 111 | ||
| 112 | m_values[columnIndex] = parser; | 112 | m_values[columnIndex] = parser; |
| 113 | 113 | ||
| @@ -176,7 +176,7 @@ void DataRow::SetValue(int32_t columnIndex, const Nullable<T>& value, DataType t · 62 unmodified lines | |||
| 176 | if (value.HasValue()) | 176 | if (value.HasValue()) |
| 177 | { | 177 | { |
| 178 | uint8_t* copy = static_cast<uint8_t*>(malloc(sizeof(T))); | 178 | uint8_t* copy = static_cast<uint8_t*>(malloc(sizeof(T))); |
| 179 | memcpy(copy, &value.Value, sizeof(T)); | 179 | memcpy(copy, &value.Value, sizeof(T)); //-V575 |
| 180 | m_values[columnIndex] = copy; | 180 | m_values[columnIndex] = copy; |
| 181 | } | 181 | } |
| 182 | else | 182 | else |
| @@ -321,7 +321,7 @@ void DataRow::SetBooleanValue(int32_t columnIndex, const Nullable<bool>& value) · 138 unmodified lines | |||
| 321 | if (value.HasValue()) | 321 | if (value.HasValue()) |
| 322 | { | 322 | { |
| 323 | uint8_t* copy = static_cast<uint8_t*>(malloc(1)); | 323 | uint8_t* copy = static_cast<uint8_t*>(malloc(1)); |
| 324 | *copy = value.GetValueOrDefault() ? 1 : 0; | 324 | *copy = value.GetValueOrDefault() ? 1 : 0; //-V522 |
| 325 | m_values[columnIndex] = copy; | 325 | m_values[columnIndex] = copy; |
| 326 | } | 326 | } |
| 327 | else | 327 | else |
| @@ -465,7 +465,7 @@ void DataRow::SetGuidValue(int32_t columnIndex, const Nullable<GSF::Guid>& value · 137 unmodified lines | |||
| 465 | if (value.HasValue()) | 465 | if (value.HasValue()) |
| 466 | { | 466 | { |
| 467 | int8_t* copy = static_cast<int8_t*>(malloc(16)); | 467 | int8_t* copy = static_cast<int8_t*>(malloc(16)); |
| 468 | memcpy(copy, value.GetValueOrDefault().data, 16); | 468 | memcpy(copy, value.GetValueOrDefault().data, 16); //-V575 |
| 469 | m_values[columnIndex] = copy; | 469 | m_values[columnIndex] = copy; |
| 470 | } | 470 | } |
| 471 | else | 471 | else |