diff -Nur kbd-2.4.0/src/libkfont/kdmapop.c kbd-2.4.0-new/src/libkfont/kdmapop.c
--- kbd-2.4.0/src/libkfont/kdmapop.c	2020-04-27 23:53:01.000000000 +0800
+++ kbd-2.4.0-new/src/libkfont/kdmapop.c	2021-12-07 16:18:53.166000000 +0800
@@ -166,7 +166,8 @@
 
 		if (ioctl(fd, GIO_UNIMAP, &ud)) {
 			KFONT_ERR(ctx, "ioctl(GIO_UNIMAP): %m");
-			return -1;
+			free(ud.entries);
+            return -1;
 		}
 		if (ct != ud.entry_ct)
 			KFONT_ERR(ctx, _("strange... ct changed from %d to %d"), ct, ud.entry_ct);
