summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/print.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/print.c b/src/print.c
index 4d1db9fe3e5..f6c7d9a3ef3 100644
--- a/src/print.c
+++ b/src/print.c
@@ -399,14 +399,19 @@ internal_with_output_to_temp_buffer (bufname, function, args)
{
int count = specpdl_ptr - specpdl;
Lisp_Object buf, val;
+ struct gcpro gcpro1;
+ GCPRO1 (args);
record_unwind_protect (Fset_buffer, Fcurrent_buffer ());
temp_output_buffer_setup (bufname);
buf = Vstandard_output;
+ UNGCPRO;
val = (*function) (args);
+ GCPRO1 (val);
temp_output_buffer_show (buf);
+ UNGCPRO;
return unbind_to (count, val);
}