diff --git a/src/Fl_JPEG_Image.cxx b/src/Fl_JPEG_Image.cxx
index 55e66be686d8e9dbfd0aab93732f7332efc90f5d..481481c079bbd44cb7aa802fde88ddc2dc3b8b63 100644
--- a/src/Fl_JPEG_Image.cxx
+++ b/src/Fl_JPEG_Image.cxx
@@ -4,7 +4,7 @@
 // Copyright 1997-2011 by Easy Software Products.
 // Image support by Matthias Melcher, Copyright 2000-2009.
 //
-// Copyright 2013-2021 by Bill Spitzak and others.
+// Copyright 2013-2025 by Bill Spitzak and others.
 //
 // This library is free software. Distribution and use rights are outlined in
 // the file "COPYING" which should have been included with this file.  If this
@@ -222,7 +222,7 @@ void Fl_JPEG_Image::load_jpg_(const char *filename, const char *sharename, const
 
   // The following variables are pointers allocating some private space that
   // is not reset by 'setjmp()'. At least under macOS, it's necessay to make
-  // these variables volatile to avoid errors occuring when compiled with -O1 (issue #1207).
+  // these variables volatile to avoid errors occurring when compiled with -O1 (issue #1207).
   volatile char* max_finish_decompress_err;      // count errors and give up after a while
   volatile char* max_destroy_decompress_err;     // to avoid recursion and deadlock
 
@@ -336,8 +336,8 @@ void Fl_JPEG_Image::load_jpg_(const char *filename, const char *sharename, const
   jpeg_finish_decompress(&dinfo);
   jpeg_destroy_decompress(&dinfo);
 
-  free((char*)max_destroy_decompress_err);
-  free((char*)max_finish_decompress_err);
+  free((void*)max_destroy_decompress_err);
+  free((void*)max_finish_decompress_err);
 
   if (*fp)
     fclose(*fp);