summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorDavid Wragg <david@rabbitmq.com>2010-07-27 19:36:36 +0100
committerDavid Wragg <david@rabbitmq.com>2010-07-27 19:36:36 +0100
commit4f30d164910f88f181489f591c0957317142da01 (patch)
tree2efeabc9c912f7471c0a0cf95d06a5544c7ac1a0 /tests
parenta39a656ffb1a72b031aa586a37ff77b39939b6fb (diff)
downloadrabbitmq-c-github-ask-4f30d164910f88f181489f591c0957317142da01.tar.gz
Free heap-allocated error strings
Even though we are about to exit anyway.
Diffstat (limited to 'tests')
-rw-r--r--tests/test_tables.c10
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();
}