Skip to content

Commit

Permalink
Merge pull request #4 from PeterDuerr/fix-memory-leaks
Browse files Browse the repository at this point in the history
Fix memory leaks indicated by cppcheck. @PeterDuerr thanks for the fix.
  • Loading branch information
VicenteEprosima authored Aug 21, 2017
2 parents 74b2ed4 + 9b7fb94 commit 50776f4
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/c/microCdr.c
Original file line number Diff line number Diff line change
Expand Up @@ -3561,6 +3561,7 @@ int8_t deserializeStringArray(char*** string_t, const uint32_t numElements, stru
result = deserializeString(&swap[i], &length, m_cdrBuffer);
if (result < 0)
{
free(swap);
return -1;
}
m_cdrBuffer->m_lastDataSize = sizeof(char);
Expand Down Expand Up @@ -3592,6 +3593,7 @@ int8_t deserializeStringArrayEndianness(char*** string_t, const uint32_t numElem
result = deserializeStringEndianness(&swap[i], &length, endianness, m_cdrBuffer);
if (result < 0)
{
free(swap);
return -1;
}
m_cdrBuffer->m_lastDataSize = sizeof(char);
Expand Down

0 comments on commit 50776f4

Please sign in to comment.