libimcv: Fixed memory leak
authorAndreas Steffen <andreas.steffen@strongswan.org>
Wed, 24 May 2017 04:35:32 +0000 (06:35 +0200)
committerAndreas Steffen <andreas.steffen@strongswan.org>
Sat, 8 Jul 2017 21:19:51 +0000 (23:19 +0200)
src/libimcv/tcg/swid/tcg_swid_attr_req.c

index 41822d9..be35ee4 100644 (file)
@@ -201,6 +201,7 @@ METHOD(pa_tnc_attr_t, process, status_t,
                if (!reader->read_data16(reader, &tag_creator))
                {
                        DBG1(DBG_TNC, "insufficient data for Tag Creator field");
+                       reader->destroy(reader);
                        return FAILED;
                }
                *offset += 2 + tag_creator.len;
@@ -208,6 +209,7 @@ METHOD(pa_tnc_attr_t, process, status_t,
                if (!reader->read_data16(reader, &unique_sw_id))
                {
                        DBG1(DBG_TNC, "insufficient data for Unique Software ID");
+                       reader->destroy(reader);
                        return FAILED;
                }
                *offset += 2 + unique_sw_id.len;