Skip to content

Commit

Permalink
Deallocate arrays with proper destructor (#114)
Browse files Browse the repository at this point in the history
* Deallocate arrays with proper destructor

Signed-off-by: Timothy Parys <[email protected]>

* Replace correct line in deallocator update.

Signed-off-by: Timothy Parys <[email protected]>
  • Loading branch information
tparys authored Sep 14, 2021
1 parent bcd74e0 commit e8b71ac
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/cpp/Cdr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2709,7 +2709,7 @@ Cdr& Cdr::deserializeStringSequence(
}
catch (eprosima::fastcdr::exception::Exception& ex)
{
free(sequence_t);
delete [] sequence_t;
sequence_t = NULL;
setState(state_before_error);
ex.raise();
Expand All @@ -2735,7 +2735,7 @@ Cdr& Cdr::deserializeWStringSequence(
}
catch (eprosima::fastcdr::exception::Exception& ex)
{
free(sequence_t);
delete [] sequence_t;
sequence_t = NULL;
setState(state_before_error);
ex.raise();
Expand Down
4 changes: 2 additions & 2 deletions src/cpp/FastCdr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -776,7 +776,7 @@ FastCdr& FastCdr::deserializeStringSequence(
}
catch (eprosima::fastcdr::exception::Exception& ex)
{
free(sequence_t);
delete [] sequence_t;
sequence_t = NULL;
setState(state_before_error);
ex.raise();
Expand All @@ -802,7 +802,7 @@ FastCdr& FastCdr::deserializeWStringSequence(
}
catch (eprosima::fastcdr::exception::Exception& ex)
{
free(sequence_t);
delete [] sequence_t;
sequence_t = NULL;
setState(state_before_error);
ex.raise();
Expand Down

0 comments on commit e8b71ac

Please sign in to comment.