aboutsummaryrefslogtreecommitdiffstats
path: root/libaxl_context_free.c
diff options
context:
space:
mode:
authorMattias Andrée <maandree@kth.se>2020-04-20 18:58:00 +0200
committerMattias Andrée <maandree@kth.se>2020-04-20 18:58:00 +0200
commitda8b1c1d1baafb9cf4a0cc9a88362f161f8d1319 (patch)
tree0fb0676b127996064ccb75b695e9aaf9657ce9f1 /libaxl_context_free.c
downloadlibaxl-da8b1c1d1baafb9cf4a0cc9a88362f161f8d1319.tar.gz
libaxl-da8b1c1d1baafb9cf4a0cc9a88362f161f8d1319.tar.bz2
libaxl-da8b1c1d1baafb9cf4a0cc9a88362f161f8d1319.tar.xz
First commit
Signed-off-by: Mattias Andrée <maandree@kth.se>
Diffstat (limited to 'libaxl_context_free.c')
-rw-r--r--libaxl_context_free.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/libaxl_context_free.c b/libaxl_context_free.c
new file mode 100644
index 0000000..c86f9de
--- /dev/null
+++ b/libaxl_context_free.c
@@ -0,0 +1,12 @@
+/* See LICENSE file for copyright and license details. */
+#include "common.h"
+
+void
+libaxl_context_free(LIBAXL_CONTEXT *ctx)
+{
+ if (ctx && !--ctx->refcount) {
+ free(ctx->out_buf);
+ free(ctx->in_buf);
+ free(ctx);
+ }
+}