]> git.eshelyaron.com Git - emacs.git/commitdiff
Fix issues with type casting in delayed message functions
authorLars Ingebrigtsen <larsi@gnus.org>
Mon, 25 Oct 2021 00:19:39 +0000 (02:19 +0200)
committerLars Ingebrigtsen <larsi@gnus.org>
Mon, 25 Oct 2021 00:19:44 +0000 (02:19 +0200)
* src/eval.c (with_delayed_message_display)
(with_delayed_message_cancel, Ffuncall_with_delayed_message): Fix
some type confusion.

src/eval.c

index 110b67b587fdc254cb062135d40b1ce7cfab3f2b..94ad060773281acb2a1298b8a6290a45855e77a3 100644 (file)
@@ -1082,12 +1082,13 @@ usage: (while TEST BODY...)  */)
 static void
 with_delayed_message_display (struct atimer *timer)
 {
-  message3 (timer->client_data);
+  message3 (build_string (timer->client_data));
 }
 
 static void
 with_delayed_message_cancel (void *timer)
 {
+  xfree (((struct atimer *) timer)->client_data);
   cancel_atimer (timer);
 }
 
@@ -1111,13 +1112,11 @@ is not displayed.  */)
   struct timespec interval = dtotimespec (XFLOATINT (timeout));
   struct atimer *timer = start_atimer (ATIMER_RELATIVE, interval,
                                       with_delayed_message_display,
-                                      message);
+                                      xstrdup (SSDATA (message)));
   record_unwind_protect_ptr (with_delayed_message_cancel, timer);
 
   Lisp_Object result = CALLN (Ffuncall, function);
 
-  cancel_atimer (timer);
-
   return unbind_to (count, result);
 }