diff -up kbd-2.1.0/src/kdmapop.c.orig kbd-2.1.0/src/kdmapop.c
--- kbd-2.1.0/src/kdmapop.c.orig	2019-05-07 11:21:10.000000000 +0200
+++ kbd-2.1.0/src/kdmapop.c	2019-07-17 14:38:15.799967669 +0200
@@ -155,6 +155,7 @@ int getunimap(int fd, struct unimapdesc
 		}
 		if (ioctl(fd, GIO_UNIMAP, &ud)) {
 			perror("GIO_UNIMAP");
+			free(ud.entries);
 			return -1;
 		}
 		if (ct != ud.entry_ct)
diff -up kbd-2.1.0/src/setfont.c.orig kbd-2.1.0/src/setfont.c
--- kbd-2.1.0/src/setfont.c.orig	2019-06-25 18:14:32.000000000 +0200
+++ kbd-2.1.0/src/setfont.c	2019-07-17 14:39:57.928188355 +0200
@@ -323,6 +323,8 @@ do_loadfont(int fd, char *inbuf, int wid
 
 	if (putfont(fd, buf, fontsize, width, hwunit))
 		exit(EX_OSERR);
+
+	free(buf);
 }
 
 static void
