dbg_visit() calls format_lens() to display the lens information. The caller of
format_lens() must free the memory allocated, just do it.
---
 src/get.c |    6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/src/get.c b/src/get.c
index c1e206c..734abf6 100644
--- a/src/get.c
+++ b/src/get.c
@@ -825,11 +825,13 @@ static struct frame *pop_frame(struct rec_state *state) {
 
 static void dbg_visit(struct lens *lens, char action, size_t start, size_t end,
                       int fused, int lvl) {
-
+    char *lns;
     for (int i=0; i < lvl; i++)
         fputc(' ', stderr);
+    lns = format_lens(lens);
     fprintf(stderr, "%c %zd..%zd %d %s\n", action, start, end,
-            fused, format_lens(lens));
+            fused, lns);
+    free(lns);
 }
 
 static void get_terminal(struct frame *top, struct lens *lens,
-- 
1.7.9.5

_______________________________________________
augeas-devel mailing list
[email protected]
https://www.redhat.com/mailman/listinfo/augeas-devel

Reply via email to