From 4f30d164910f88f181489f591c0957317142da01 Mon Sep 17 00:00:00 2001 From: David Wragg Date: Tue, 27 Jul 2010 19:36:36 +0100 Subject: Free heap-allocated error strings Even though we are about to exit anyway. --- tests/test_tables.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'tests') diff --git a/tests/test_tables.c b/tests/test_tables.c index 1a0652a..9c8a041 100644 --- a/tests/test_tables.c +++ b/tests/test_tables.c @@ -210,8 +210,9 @@ static void test_table_codec(void) { int decoding_offset = 0; result = amqp_decode_table(decoding_bytes, &pool, &decoded, &decoding_offset); if (result < 0) { - printf("Table decoding failed: %d (%s)\n", result, - amqp_error_string(-result)); + char *errstr = amqp_error_string(-result); + printf("Table decoding failed: %d (%s)\n", result, errstr); + free(errstr); abort(); } printf("BBBBBBBBBB\n"); @@ -229,8 +230,9 @@ static void test_table_codec(void) { result = amqp_encode_table(encoding_result, &table, &offset); if (result < 0) { - printf("Table encoding failed: %d (%s)\n", result, - amqp_error_string(-result)); + char *errstr = amqp_error_string(-result); + printf("Table encoding failed: %d (%s)\n", result, errstr); + free(errstr); abort(); } -- cgit v1.2.1