summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2018-11-14 14:06:07 +0100
committerDavid Robillard <d@drobilla.net>2018-11-14 14:10:28 +0100
commitcec3573682114fe02b05d7e353f2059eb0bfe4d9 (patch)
treec81a12e6cd21ebcdee27d4cb4ac4f00092f35fcc
parent072202011fc7fe7bc7e4d8408066e2b89a0061d1 (diff)
downloadzix-cec3573682114fe02b05d7e353f2059eb0bfe4d9.tar.gz
zix-cec3573682114fe02b05d7e353f2059eb0bfe4d9.tar.bz2
zix-cec3573682114fe02b05d7e353f2059eb0bfe4d9.zip
Fix potential memory leaks in test
-rw-r--r--test/ring_test.c3
1 files changed, 3 insertions, 0 deletions
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;
}