summaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
Diffstat (limited to 'examples')
-rw-r--r--examples/utils.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/examples/utils.c b/examples/utils.c
index 4b00470..5d4a1f9 100644
--- a/examples/utils.c
+++ b/examples/utils.c
@@ -59,9 +59,7 @@ void die(const char *fmt, ...)
void die_on_error(int x, char const *context)
{
if (x < 0) {
- char *errstr = amqp_error_string(-x);
- fprintf(stderr, "%s: %s\n", context, errstr);
- free(errstr);
+ fprintf(stderr, "%s: %s\n", context, amqp_error_string(x));
exit(1);
}
}