From 9b7fb9466904dc8f3c727b71126f395f168c6f7f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Peter=20D=C3=BCrr?= Date: Mon, 7 Aug 2017 15:50:08 +0200 Subject: [PATCH] Fix memory leaks indicated by cppcheck --- src/c/microCdr.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/c/microCdr.c b/src/c/microCdr.c index 2044687..20ba863 100644 --- a/src/c/microCdr.c +++ b/src/c/microCdr.c @@ -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); @@ -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);