From 5b44035ebace89adfde4f4830cfa87870b64caf3 Mon Sep 17 00:00:00 2001 From: "Roger A. Light" Date: Sun, 16 Oct 2022 21:44:13 +0100 Subject: [PATCH] Fix Coverity Scan 1499798, 1499803, 1499813. --- test/unit/property_read.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/test/unit/property_read.c b/test/unit/property_read.c index 74464070..7dbf7f6f 100644 --- a/test/unit/property_read.c +++ b/test/unit/property_read.c @@ -398,6 +398,9 @@ static void TEST_no_properties(void) CU_ASSERT_EQUAL(rc, MOSQ_ERR_SUCCESS); CU_ASSERT_PTR_EQUAL(properties, NULL); CU_ASSERT_EQUAL(packet.pos, 1); + if(properties){ + mosquitto_property_free_all(&properties); + } } static void TEST_truncated(void) @@ -439,6 +442,9 @@ static void TEST_truncated(void) CU_ASSERT_EQUAL(rc, MOSQ_ERR_MALFORMED_PACKET); CU_ASSERT_PTR_EQUAL(properties, NULL); CU_ASSERT_EQUAL(packet.pos, 2); + if(properties){ + mosquitto_property_free_all(&properties); + } } /* ======================================================================== @@ -474,6 +480,9 @@ static void TEST_invalid_property_id(void) CU_ASSERT_EQUAL(rc, MOSQ_ERR_MALFORMED_PACKET); CU_ASSERT_PTR_EQUAL(properties, NULL); CU_ASSERT_EQUAL(packet.pos, 2); + if(properties){ + mosquitto_property_free_all(&properties); + } } /* ========================================================================