diff options
Diffstat (limited to 'tests/test_tables.c')
-rw-r--r-- | tests/test_tables.c | 10 |
1 files changed, 6 insertions, 4 deletions
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(); } |