vconsole-setup: Store fonts on heap (#3268)

More friendly to the stack.
This commit is contained in:
Kyle Russell
2016-05-16 10:41:30 -04:00
committed by Zbigniew Jędrzejewski-Szmek
parent 7656702318
commit 6a08e1b0cd
+7 -1
View File
@@ -195,9 +195,15 @@ static void font_copy_to_all_vcs(int fd) {
unsigned char map8[E_TABSZ];
unsigned short map16[E_TABSZ];
struct unimapdesc unimapd;
struct unipair unipairs[USHRT_MAX];
_cleanup_free_ struct unipair* unipairs = NULL;
int i, r;
unipairs = new(struct unipair, USHRT_MAX);
if (unipairs == NULL) {
log_error("Not enough memory to copy fonts");
return;
}
/* get active, and 16 bit mask of used VT numbers */
r = ioctl(fd, VT_GETSTATE, &vcs);
if (r < 0) {