summaryrefslogtreecommitdiff
path: root/gdb/ax-general.c
diff options
context:
space:
mode:
Diffstat (limited to 'gdb/ax-general.c')
-rw-r--r--gdb/ax-general.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/gdb/ax-general.c b/gdb/ax-general.c
index 34ec3b3071e..4612e8ea42f 100644
--- a/gdb/ax-general.c
+++ b/gdb/ax-general.c
@@ -62,6 +62,18 @@ free_agent_expr (x)
free (x);
}
+static void
+do_free_agent_expr_cleanup (void *x)
+{
+ free_agent_expr (x);
+}
+
+struct cleanup *
+make_cleanup_free_agent_expr (struct agent_expr *x)
+{
+ return make_cleanup (do_free_agent_expr_cleanup, x);
+}
+
/* Make sure that X has room for at least N more bytes. This doesn't
affect the length, just the allocated size. */