Skip to content

Commit

Permalink
Fix memory leaks in tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
ralight committed Dec 14, 2018
1 parent 699e5c7 commit 8b368ae
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions test/unit/property_write.c
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ static void byte_prop_write_helper(
mosquitto_property_free_all(&properties);
}
CU_ASSERT_PTR_EQUAL(properties, NULL);
free(packet.payload);
}


Expand Down Expand Up @@ -82,6 +83,7 @@ static void int32_prop_write_helper(
mosquitto_property_free_all(&properties);
}
CU_ASSERT_PTR_EQUAL(properties, NULL);
free(packet.payload);
}


Expand Down Expand Up @@ -122,6 +124,7 @@ static void int16_prop_write_helper(
mosquitto_property_free_all(&properties);
}
CU_ASSERT_PTR_EQUAL(properties, NULL);
free(packet.payload);
}

static void string_prop_write_helper(
Expand Down Expand Up @@ -164,6 +167,7 @@ static void string_prop_write_helper(
}
CU_ASSERT_PTR_EQUAL(properties, NULL);
free(property.value.s.v);
free(packet.payload);
}


Expand Down Expand Up @@ -209,6 +213,7 @@ static void binary_prop_write_helper(
}
CU_ASSERT_PTR_EQUAL(properties, NULL);
free(property.value.bin.v);
free(packet.payload);
}

static void string_pair_prop_write_helper(
Expand Down Expand Up @@ -261,6 +266,7 @@ static void string_pair_prop_write_helper(
CU_ASSERT_PTR_NULL(properties);
free(property.value.s.v);
free(property.name.v);
free(packet.payload);
}

static void varint_prop_write_helper(
Expand Down Expand Up @@ -308,6 +314,7 @@ static void varint_prop_write_helper(
mosquitto_property_free_all(&properties);
}
CU_ASSERT_PTR_NULL(properties);
free(packet.payload);
}

/* ========================================================================
Expand Down

0 comments on commit 8b368ae

Please sign in to comment.