From cec3573682114fe02b05d7e353f2059eb0bfe4d9 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Wed, 14 Nov 2018 14:06:07 +0100 Subject: Fix potential memory leaks in test --- test/ring_test.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'test') diff --git a/test/ring_test.c b/test/ring_test.c index 33f1f02..85815a8 100644 --- a/test/ring_test.c +++ b/test/ring_test.c @@ -215,14 +215,17 @@ main(int argc, char** argv) char* big_buf = (char*)calloc(size, 1); n = zix_ring_write(ring, big_buf, size - 1); if (n != (uint32_t)size - 1) { + free(big_buf); return failure("Maximum size write failed (wrote %u)\n", n); } n = zix_ring_write(ring, big_buf, size); if (n != 0) { + free(big_buf); return failure("Successful overrun write (size %u)\n", n); } + free(big_buf); zix_ring_free(ring); return 0; } -- cgit v1.2.1